:root {
  --bg: #e6e8ec;
  --bg-2: #d7dce2;
  --panel: #e8ebef;
  --panel-hi: #f4f6f9;
  --text: #111827;
  --muted: #4b5563;
  --accent: #f59e0b;
  --accent-2: #2563eb;
  --ok: #16a34a;
  --bad: #dc2626;
  --stroke: rgba(120, 131, 150, 0.22);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-out: 4px 4px 10px rgba(128, 138, 158, 0.24), -3px -3px 8px rgba(255, 255, 255, 0.72);
  --shadow-in: inset 2px 2px 5px rgba(146, 156, 176, 0.18), inset -2px -2px 5px rgba(255, 255, 255, 0.8);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.45), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(207, 214, 226, 0.45), transparent 42%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

.page-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.auth-card {
  width: min(440px, 100%);
  background: linear-gradient(160deg, var(--panel-hi), var(--panel));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-out);
  border: 1px solid var(--stroke);
  padding: 28px;
}

.auth-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.02em;
}

.auth-sub {
  margin-top: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 16px;
}

.sidebar {
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  border-radius: var(--radius-xl);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.05),
    0 6px 16px rgba(120, 131, 150, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 20px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid rgba(120, 131, 150, 0.15);
  background: linear-gradient(180deg, #eef2f6, #f8fafc);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand h1 {
  font-size: 19px;
  font-weight: 850;
  margin: 0;
  letter-spacing: 0.02em;
  color: #1e293b;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.brand p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav button {
  border: 1px solid rgba(120, 131, 150, 0.2);
  text-align: left;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #e2e8f0);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    inset 0 2px 2px rgba(255,255,255,1);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  color: #334155;
  transition: all 0.15s ease;
  font-size: 14px;
}

.nav button:hover {
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  box-shadow: 
    0 4px 6px rgba(0,0,0,0.08),
    inset 0 2px 2px rgba(255,255,255,1);
  transform: translateY(-1px);
}

.nav button:active {
  background: linear-gradient(180deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transform: translateY(1px);
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages {
  min-height: 420px;
  max-height: 58vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #eef2f6, #f8fafc);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(120, 131, 150, 0.2);
  padding: 16px;
}

.chat-bubble {
  max-width: 78%;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 4px 6px rgba(0,0,0,0.05),
    inset 0 2px 2px rgba(255,255,255,0.9);
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.user {
  margin-left: auto;
  background: linear-gradient(160deg, #fcd34d, #f59e0b);
  color: #451a03;
  border-color: rgba(252, 211, 77, 0.8);
  box-shadow: 
    0 4px 6px rgba(245, 158, 11, 0.15),
    inset 0 2px 2px rgba(255,255,255,0.6);
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  margin-right: auto;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.chat-shell {
  margin-top: 14px;
  position: relative;
}

.sentiment-cookie-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sentiment-cookie-automation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #f8fafc;
}

.sentiment-cookie-automation-actions,
.sentiment-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sentiment-cookie-advanced {
  width: 100%;
  color: #475569;
  font-size: 13px;
}

.sentiment-cookie-advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.sentiment-cookie-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sentiment-cookie-steps {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.sentiment-cookie-editor textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.sentiment-cookie-names {
  max-width: 320px;
  word-break: break-word;
}

.sentiment-cookie-detail {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.sentiment-cookie-detail.ready {
  color: #166534;
}

.sentiment-cookie-detail.missing {
  color: #b91c1c;
}

.sentiment-cookie-detail.unknown {
  color: #475569;
}

.sentiment-cookie-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sentiment-cookie-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.sentiment-cookie-live[data-state="warning"] {
  color: #92400e;
}

.sentiment-cookie-live[data-state="warning"] .sentiment-cookie-live-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.sentiment-cookie-state-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sentiment-cookie-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #dbe4ea;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.sentiment-cookie-state-pill strong {
  color: inherit;
  font-weight: 800;
}

.sentiment-cookie-state-pill.inactive {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.sentiment-cookie-state-pill.ready {
  border-color: #a7e3c2;
  background: #ecfdf3;
  color: #166534;
}

.sentiment-cookie-state-pill.missing {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.sentiment-cookie-state-pill.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.sentiment-cookie-hint,
.sentiment-cookie-updated {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.sentiment-cookie-updated {
  color: #94a3b8;
}

.sentiment-cookie-table .badge.healthy,
.sentiment-cookie-table .badge.ok {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.sentiment-cookie-table .badge.watch,
.sentiment-cookie-table .badge.degraded {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.sentiment-cookie-table .badge.expired,
.sentiment-cookie-table .badge.missing {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

@media (max-width: 900px) {
  .sentiment-cookie-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sentiment-cookie-automation {
    align-items: stretch;
    flex-direction: column;
  }
}

.chat-timeline {
  min-height: 420px;
  max-height: 58vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #eef2f6, #f8fafc);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(120, 131, 150, 0.2);
  padding: 16px;
}

.chat-input-wrap {
  margin-top: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.05),
    0 6px 16px rgba(120, 131, 150, 0.15);
  padding: 16px;
  position: relative;
}

.chat-input-wrap.dragging {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12), var(--shadow-out);
}

.chat-input-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 10px;
}

.chat-input-head .spacer {
  flex: 1;
}

.chat-param-btn {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.chat-batch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.chat-batch-toggle .toggle-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.chat-input-wrap button,
.chat-input-wrap .file-btn {
  padding: 8px 11px;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.chat-files {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-in);
  border: 1px solid rgba(120, 131, 150, 0.18);
  background: linear-gradient(160deg, #f9fbff, #edf1f8);
  min-height: 44px;
}

.chat-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.chat-controls-left {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.chat-controls-left .select {
  width: 220px;
  max-width: 240px;
  flex: 0 0 auto;
  padding: 9px 10px;
}

.chat-controls-right {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.file-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.file-item {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 131, 150, 0.18);
  background: linear-gradient(160deg, var(--panel-hi), var(--panel));
  box-shadow: var(--shadow-out);
  padding: 10px;
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.file-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.file-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  line-height: 0;
}

.file-thumb {
  width: 100%;
  height: 78px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #f9fbff, #e7ebf1);
  box-shadow: var(--shadow-in);
  border: 1px solid rgba(120, 131, 150, 0.16);
  margin-bottom: 8px;
}

.file-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb-badge {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(17, 24, 39, 0.62);
  font-weight: 850;
  letter-spacing: 0.06em;
  font-size: 12px;
}

.chat-event {
  margin: 12px 0;
}

.chat-event-line {
  display: none;
}

.chat-event-pill {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(120, 131, 150, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0)),
    linear-gradient(160deg, #f9fbff, #edf2f8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(126, 142, 168, 0.12);
  color: var(--text);
}

.chat-event-pill.success {
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.82), rgba(255, 255, 255, 0)),
    linear-gradient(160deg, #fbfefc, #e8f4ee);
  border-color: rgba(22, 163, 74, 0.14);
}

.chat-event-pill.failed {
  background:
    linear-gradient(180deg, rgba(254, 242, 242, 0.86), rgba(255, 255, 255, 0)),
    linear-gradient(160deg, #fffafb, #f4e8ea);
  border-color: rgba(220, 38, 38, 0.16);
}

.chat-event-pill.running,
.chat-event-pill.progress {
  border-color: rgba(37, 99, 235, 0.14);
}

.chat-event-pill.queued {
  border-color: rgba(124, 58, 237, 0.16);
}

.chat-event-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(120, 131, 150, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(237, 241, 248, 0.95));
  color: #475569;
}

.chat-event-badge.success {
  color: #047857;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
}

.chat-event-badge.failed {
  color: #b91c1c;
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
}

.chat-event-badge.running,
.chat-event-badge.progress {
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}

.chat-event-badge.queued {
  color: #7c3aed;
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
}

.chat-event-badge.log {
  color: #475569;
}

.chat-event-title {
  font-size: 13.5px;
  font-weight: 780;
  color: #0f172a;
}

.chat-event-detail {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.chat-event-detail-item,
.chat-event-link {
  display: block;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(120, 131, 150, 0.14);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(237, 241, 248, 0.94));
  box-shadow: var(--shadow-in);
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-event-link {
  color: #2563eb;
  font-weight: 650;
}

.chat-event-link:hover {
  filter: brightness(0.98);
}

.toggle-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.twist-toggle input {
  display: none;
}

.twist-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(160deg, #f9fbff, #e1e6ee);
  border: 1px solid rgba(120, 131, 150, 0.2);
  box-shadow: var(--shadow-in);
  position: relative;
  display: inline-block;
}

.twist-knob {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(160deg, #ffffff, #e7ebf1);
  box-shadow: var(--shadow-out);
  transform: translate(0, -50%);
  transition: transform 0.22s ease, background 0.22s ease;
}

.twist-toggle input:checked + .twist-track .twist-knob {
  transform: translate(18px, -50%);
  background: linear-gradient(160deg, #f6cd8c, #f2a72d);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(120, 131, 150, 0.2);
  background: linear-gradient(160deg, #ffffff, #e7ebf1);
  box-shadow: var(--shadow-out);
  cursor: pointer;
  position: relative;
  padding: 0;
}

.icon-btn.plus {
  font-size: 0;
}

.icon-btn.plus::before,
.icon-btn.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  background: rgba(17, 24, 39, 0.55);
  border-radius: 2px;
  transform: translate(-50%, -50%);
}

.icon-btn.plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.icon-btn:hover {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08), var(--shadow-out);
}

.icon-btn:active {
  box-shadow: var(--shadow-in);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(120, 131, 150, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
}

.page-admin .modal-close-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  color: #475569;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

.page-admin .modal-close-icon:hover,
.page-admin .modal-close-icon:focus-visible {
  color: #172033;
  background: rgba(226, 232, 240, 0.72);
  border: 0;
  box-shadow: none;
}

.page-admin .modal-close-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.modal-title {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.02em;
  color: #1e293b;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.modal-body {
  padding: 20px 24px;
  overflow: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid rgba(120, 131, 150, 0.15);
  background: linear-gradient(0deg, rgba(226, 232, 240, 0.4), rgba(255, 255, 255, 0));
}

.modal-footer .row {
  flex-wrap: wrap;
}

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

.param-col {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background: linear-gradient(160deg, #eef2f7, #e7ebf1);
  box-shadow: var(--shadow-in);
  padding: 12px;
  min-height: 180px;
  max-height: 62vh;
  overflow: auto;
}

.param-col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.param-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.param-item {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 131, 150, 0.18);
  background: linear-gradient(160deg, var(--panel-hi), var(--panel));
  box-shadow: var(--shadow-out);
  padding: 12px;
}

.param-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.param-item-title {
  font-weight: 850;
  font-size: 12.5px;
  color: var(--muted);
}

.param-remove {
  padding: 8px 10px;
}

.param-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.param-row.one {
  grid-template-columns: 1fr;
}

.modal-warn {
  margin-top: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.08));
  box-shadow: var(--shadow-in);
  padding: 12px;
}

@media (max-width: 860px) {
  .param-grid {
    grid-template-columns: 1fr;
  }
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

.chat-composer {
  margin-top: 12px;
}

.card {
  background: linear-gradient(160deg, var(--panel-hi), var(--panel));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-out);
  border: 1px solid var(--stroke);
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  color: #0f172a;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-head-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-in);
}

.kpi .label {
  font-size: 12px;
  color: var(--muted);
}

.kpi .num {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 760;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: block;
  margin: 8px 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  word-break: keep-all;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(120, 131, 150, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #fafcff, #e9edf3);
  box-shadow: var(--shadow-in);
  padding: 11px 12px;
  color: var(--text);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

button,
.btn {
  border: 1px solid rgba(120, 131, 150, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #f6f8fc, #e4e8ee);
  box-shadow: var(--shadow-out);
  padding: 10px 14px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

button.primary,
.btn.primary {
  background: linear-gradient(160deg, #ffd08b, #f59e0b);
  color: #5c3300;
}

button.blue,
.btn.blue {
  background: linear-gradient(160deg, #98bbff, #2563eb);
  color: #e8f0ff;
}

button.ghost,
.btn.ghost {
  box-shadow: var(--shadow-in);
}

button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row > * {
  flex: 1;
}

.msg {
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
}

.msg.ok {
  color: var(--ok);
}

.msg.err {
  color: var(--bad);
}

.admin-create-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.admin-create-actions .switch {
  flex: 0 0 auto;
}

.admin-create-actions button {
  flex: 0 0 auto;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

.table th {
  text-align: left;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 10px;
}

.table td {
  background: linear-gradient(160deg, #f8fafc, #e7ebf1);
  box-shadow: var(--shadow-in);
  padding: 10px;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table th:nth-child(1),
.table td:nth-child(1) {
  width: 260px;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  width: 140px;
}

.table th:nth-child(3),
.table td:nth-child(3) {
  width: 110px;
}

.table th:nth-child(4),
.table td:nth-child(4) {
  width: 120px;
}

.table th:nth-child(5),
.table td:nth-child(5) {
  width: 170px;
}

.table th:nth-child(6),
.table td:nth-child(6) {
  width: 90px;
}

.table th:nth-child(7),
.table td:nth-child(7) {
  width: 120px;
}

.table th:nth-child(8),
.table td:nth-child(8) {
  width: 190px;
}

.table td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.table td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}


.section {
  scroll-margin-top: 20px;
}

.switch {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
}

label.switch {
  margin: 0;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.admin-task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-task-actions .task-action-select {
  min-width: 0;
  flex: 1 1 auto;
  padding: 8px 10px;
}

.admin-task-actions button {
  flex: 0 0 auto;
  padding: 8px 12px;
}

.task-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-kpi {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #f0f4f8, #e2e8f0);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.05),
    0 6px 12px rgba(120, 131, 150, 0.15);
}

.task-kpi::after {
  content: "";
  position: absolute;
  inset: auto -14px -22px auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.05) 70%, transparent 72%);
  pointer-events: none;
}

.task-kpi:nth-child(2)::after {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25), rgba(37, 99, 235, 0.05) 70%, transparent 72%);
}

.task-kpi:nth-child(3)::after {
  background: radial-gradient(circle, rgba(22, 163, 74, 0.22), rgba(22, 163, 74, 0.05) 70%, transparent 72%);
}

.task-kpi:nth-child(4)::after {
  background: radial-gradient(circle, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.05) 70%, transparent 72%);
}

.task-kpi .label {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.task-kpi .num {
  position: relative;
  z-index: 1;
  font-size: 32px;
  line-height: 1;
  font-weight: 850;
  color: #1e293b;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.task-kpi .small {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-weight: 600;
}

.task-toolbar {
  margin-top: 14px;
  position: sticky;
  top: 14px;
  z-index: 5;
  padding: 15px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(160deg, rgba(248, 250, 252, 0.92), rgba(226, 232, 240, 0.92));
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(0, 0, 0, 0.05),
    0 8px 20px rgba(120, 131, 150, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.task-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-filter-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-meta-line {
  margin-top: 2px;
}

.task-list {
  margin-top: 14px;
  display: grid;
  gap: 16px;
}

.task-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.05),
    0 6px 16px rgba(120, 131, 150, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(120, 131, 150, 0.2);
  border-color: #ffffff;
}

.task-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.task-card-main {
  min-width: 0;
}

.task-card-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.task-card-title {
  font-size: 17px;
  font-weight: 850;
  color: #1e293b;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  letter-spacing: 0.01em;
}

.task-card-subtitle {
  margin-top: 6px;
  color: #64748b;
  font-weight: 600;
  font-size: 12.5px;
}

.task-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-left: 12px;
}

.task-action-btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 750;
  background: linear-gradient(180deg, #ffffff, #e2e8f0);
  border: 1px solid rgba(120, 131, 150, 0.3);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    inset 0 2px 2px rgba(255,255,255,1);
  color: #334155;
  transition: all 0.15s ease;
}

.task-action-btn:hover {
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  box-shadow: 
    0 4px 6px rgba(0,0,0,0.08),
    inset 0 2px 2px rgba(255,255,255,1);
}

.task-action-btn:active {
  background: linear-gradient(180deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transform: translateY(1px);
}

.task-chip-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    inset 0 1px 1px rgba(255,255,255,1);
  font-size: 12px;
  font-weight: 650;
  color: #475569;
}

.meta-chip-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: #334155;
  font-weight: 700;
}

.task-card-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.task-card-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 131, 150, 0.2);
  background: linear-gradient(180deg, #eef2f6, #f8fafc);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.task-card-item-wide {
  grid-column: span 2;
}

.task-card-label {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.task-card-value {
  color: #0f172a;
  font-weight: 750;
  font-size: 13.5px;
  word-break: break-word;
}

.task-card-rh {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-card-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(254, 242, 242, 0.95), rgba(254, 226, 226, 0.9));
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #991b1b;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    0 2px 4px rgba(220, 38, 38, 0.05);
}

.task-empty {
  margin-top: 14px;
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(120, 131, 150, 0.25);
  background: linear-gradient(160deg, rgba(248, 250, 252, 0.8), rgba(226, 232, 240, 0.8));
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
}

.task-empty-inline {
  margin-top: 0;
}

.simple-task-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.simple-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
}

.simple-task-title {
  font-weight: 800;
}

.simple-task-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.05),
    inset 0 1px 1px rgba(255,255,255,1);
}

.pill.running {
  color: #1d4ed8;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 
    0 2px 4px rgba(59, 130, 246, 0.1),
    inset 0 1px 1px rgba(255,255,255,1);
}

.pill.success {
  color: #047857;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 
    0 2px 4px rgba(16, 185, 129, 0.1),
    inset 0 1px 1px rgba(255,255,255,1);
}

.pill.failed {
  color: #b91c1c;
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 
    0 2px 4px rgba(239, 68, 68, 0.1),
    inset 0 1px 1px rgba(255,255,255,1);
}

.pill.queued {
  color: #7c3aed;
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 
    0 2px 4px rgba(139, 92, 246, 0.1),
    inset 0 1px 1px rgba(255,255,255,1);
}

.admin-task-modal {
  width: min(1040px, 100%);
}

.inspect-stack {
  display: grid;
  gap: 14px;
}

.inspect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.inspect-item {
  padding: 12px 13px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    linear-gradient(160deg, #f9fbff, #edf1f8);
  box-shadow: var(--shadow-in);
}

.inspect-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.inspect-value {
  color: var(--text);
  font-weight: 650;
  word-break: break-word;
}

.inspect-note {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background: linear-gradient(160deg, #f9fbff, #edf1f8);
}

.inspect-note-bad {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.16);
}

.inspect-section {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
    linear-gradient(160deg, #f9fbff, #edf1f8);
  box-shadow: var(--shadow-in);
  overflow: hidden;
}

.inspect-section-title {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 750;
  color: #0f172a;
  border-bottom: 1px solid rgba(120, 131, 150, 0.14);
}

.inspect-pre {
  margin: 0;
  padding: 14px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.inspect-log-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.inspect-log-item {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background: linear-gradient(160deg, #fcfdff, #edf1f8);
  box-shadow: var(--shadow-in);
}

.inspect-log-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.inspect-log-text {
  margin-top: 6px;
  color: var(--text);
  font-weight: 650;
  line-height: 1.5;
}

.inspect-log-extra {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-block {
  margin-top: 8px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-in);
  border: 1px solid rgba(120, 131, 150, 0.16);
  background: linear-gradient(160deg, #edf1f6, #e7ebf1);
}

.composer-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(180px, 260px) minmax(120px, 1fr);
  gap: 10px;
  align-items: end;
}

.control-item {
  min-width: 0;
}

.control-action {
  display: flex;
  justify-content: flex-end;
}

.control-action button {
  width: auto;
}

.file-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding-right: 2px;
}

.upload-slot.mode-optional {
  opacity: 0.58;
  filter: saturate(0.78);
  border-style: dashed;
  position: relative;
}

.upload-slot.mode-optional::after {
  content: "可跳过";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(120, 131, 150, 0.2);
}

.upload-slot.mode-required {
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.22),
    0 10px 24px rgba(245, 158, 11, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.75);
}

.recent-image-card {
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.recent-image-thumb {
  margin-top: 14px;
  min-height: 72px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(15, 138, 95, 0.08));
  color: #334155;
  font-weight: 700;
  font-size: 12px;
}

.recent-image-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 72px;
  object-fit: cover;
}

.recent-image-mode {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #0f8a5f;
  background: rgba(15, 138, 95, 0.1);
  border: 1px solid rgba(15, 138, 95, 0.16);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .kpi-row,
  .grid-2,
  .grid-3,
  .task-summary,
  .task-filter-grid,
  .task-filter-grid-compact,
  .inspect-grid {
    grid-template-columns: 1fr;
  }

  .composer-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .control-action {
    justify-content: stretch;
  }

  .control-action button {
    width: 100%;
  }

  .section-head,
  .task-card-head {
    flex-direction: column;
  }

  .section-head-side,
  .task-card-actions {
    align-items: stretch;
  }

  .task-card-grid {
    grid-template-columns: 1fr;
  }

  .task-card-item-wide {
    grid-column: span 1;
  }

  .task-toolbar {
    position: static;
  }
}

/* Product packaging skin */
:root {
  --bg: #f6f7f9;
  --bg-2: #eef1f5;
  --panel: #ffffff;
  --panel-hi: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --accent: #0f8a5f;
  --accent-2: #2563eb;
  --ok: #0f8a5f;
  --bad: #c2410c;
  --stroke: #d8dde6;
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --shadow-out: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-in: none;
}

html,
body {
  background: var(--bg);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--accent-2);
}

.layout {
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--bg);
}

.sidebar,
.card,
.section,
.auth-card,
.chat-input-wrap,
.chat-timeline,
.chat-messages,
.brand,
.task-card,
.task-card-item,
.inspect-item,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow-out);
}

.sidebar {
  padding: 16px;
  gap: 16px;
}

.brand {
  padding: 14px;
  background: #ffffff;
  box-shadow: none;
}

.brand h1 {
  color: #111827;
  font-size: 17px;
  line-height: 1.25;
  text-shadow: none;
  letter-spacing: 0;
}

.brand p,
.meta,
.small,
.task-card-subtitle,
.task-card-label,
.inspect-label {
  color: var(--muted);
}

.nav {
  gap: 6px;
}

.nav button,
button,
.secondary-file-btn {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  box-shadow: none;
  color: #1f2937;
  font-weight: 700;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.nav button:hover,
button:hover,
.secondary-file-btn:hover {
  transform: none;
  background: #f8fafc;
  border-color: #b8c0cc;
  box-shadow: none;
}

button:active {
  transform: none;
  box-shadow: none;
}

button.primary,
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

button.primary:hover,
.primary:hover {
  background: #0b7551;
  border-color: #0b7551;
}

button.blue,
.blue {
  background: #1f5fbf;
  border-color: #1f5fbf;
  color: #ffffff;
}

button.ghost,
.ghost {
  background: #ffffff;
  color: #374151;
}

button.danger,
.danger {
  background: #b42318;
  border-color: #b42318;
  color: #ffffff;
}

input,
textarea,
select,
.select {
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(15, 138, 95, 0.18);
  border-color: var(--accent);
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: none;
}

.page-title h2,
.section h2,
.section h3 {
  letter-spacing: 0;
}

.status-strip,
.sidebar-actions,
.optional-upload-row,
.settings-actions,
.generator-actions,
.progress-panel-head,
.section-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-chip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #f8fafc;
}

.account-name,
.account-balance {
  font-weight: 800;
  color: #111827;
}

.generator-panel {
  display: grid;
  gap: 16px;
}

.task-type-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d9e1e8;
  border-radius: 14px;
  background: #edf1f5;
}

.task-type-tab {
  flex: 1;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.task-type-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #334155;
}

.task-type-tab.is-active {
  background: #ffffff;
  color: #0f8a5f;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08), 0 0 0 1.5px rgba(15, 138, 95, 0.18);
  font-weight: 800;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.flow-steps > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}

.flow-steps span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
}

.generator-dropzone {
  padding: 14px;
  border-style: dashed;
  background: #ffffff;
}

.upload-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upload-slot {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 188px;
  padding: 16px;
  border: 1px dashed #b8c0cc;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  overflow: hidden;
}

.upload-slot:hover,
.upload-slot:focus-within {
  border-color: var(--accent);
  background: #f4fbf8;
}

.upload-slot input,
.secondary-file-btn input,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.slot-label {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f5ef;
  color: #0b7551;
  font-size: 12px;
  font-weight: 800;
}

.slot-title {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.slot-help {
  color: var(--muted);
  font-size: 13px;
}

.slot-preview {
  display: block;
  min-height: 88px;
}

.slot-preview img,
.file-thumb {
  width: 100%;
  max-height: 108px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--stroke);
}

.secondary-file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: pointer;
}

.settings-disclosure {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.settings-disclosure summary {
  cursor: pointer;
  font-weight: 800;
}

.settings-disclosure[open] summary {
  margin-bottom: 10px;
}

.generator-actions {
  justify-content: flex-end;
}

.generator-actions button {
  min-width: 150px;
}

.progress-panel {
  display: grid;
  gap: 10px;
}

.chat-timeline,
.chat-messages {
  min-height: 220px;
  max-height: 360px;
  background: #fbfcfd;
}

.chat-bubble {
  border-radius: 8px;
  box-shadow: none;
}

.chat-bubble.user {
  background: #e7f5ef;
  color: #064e3b;
  border-color: #b7e4d1;
}

.chat-bubble.assistant,
.chat-event-pill {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: none;
}

.meta-chip,
.pill {
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #374151;
}

.pill.success {
  background: #e7f5ef;
  border-color: #a9dbc7;
  color: #0b7551;
}

.pill.failed {
  background: #fff1f0;
  border-color: #ffccc7;
  color: #b42318;
}

.pill.queued,
.pill.running {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.task-summary,
.overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-kpi {
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.task-kpi::after {
  display: none;
}

.task-kpi .num {
  color: #111827;
}

.task-toolbar {
  background: #fbfcfd;
}

.task-card:hover {
  transform: none;
}

.task-card-grid {
  gap: 10px;
}

.task-card-alert {
  border-radius: 6px;
}

.account-grid {
  align-items: start;
}

.ledger-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}

.ledger-list {
  display: grid;
  gap: 8px;
}

.ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #ffffff;
}

.ledger-title {
  font-weight: 800;
  color: #111827;
}

.ledger-amount {
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.debug-disclosure {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.modal-card-narrow {
  width: min(440px, calc(100vw - 32px));
}

.admin-public-action-modal {
  z-index: 96;
}

.admin-public-action-body {
  display: grid;
  gap: 16px;
}

.admin-public-action-message {
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-line;
}

.admin-public-action-input-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

.admin-public-action-input-field textarea {
  min-height: 88px;
  resize: vertical;
}

.table-wrap {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: auto;
}

.table {
  border-collapse: collapse;
}

.table th {
  background: #f8fafc;
  color: #374151;
}

.table th,
.table td {
  border-bottom: 1px solid var(--stroke);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .page-title,
  .section-head,
  .task-card-head {
    align-items: stretch;
  }

  .flow-steps,
  .upload-slot-grid,
  .task-summary,
  .overview-summary {
    grid-template-columns: 1fr;
  }

  .generator-actions,
  .section-head-side {
    justify-content: stretch;
  }

  .generator-actions button,
  .sidebar-actions button,
  .secondary-file-btn {
    width: 100%;
  }
}

.page-admin .admin-rail-status {
  display: grid;
  gap: 4px;
}

.page-admin .admin-rail-status-title {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}
.page-auth-shell .page-auth,
.page-auth-shell .auth-shell {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 24px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.auth-stage,
.auth-card-product {
  border-radius: 20px;
  border: 1px solid rgba(210, 218, 228, 0.92);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
}

.auth-stage {
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 248, 251, 0.9));
}

.auth-stage-head {
  max-width: 640px;
}

.auth-kicker {
  margin-bottom: 10px;
  color: #0f8a5f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-stage-title {
  margin: 0;
  color: #0f172a;
  font-size: 40px;
  line-height: 1.06;
  letter-spacing: 0;
}

.auth-stage-copy {
  margin: 16px 0 0;
  color: #5b6778;
  font-size: 15px;
  line-height: 1.7;
}

.auth-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.auth-stage-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-stage-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.auth-stage-card-title {
  margin-bottom: 8px;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

.auth-card-product {
  width: min(440px, 100%);
  margin-left: auto;
  padding: 26px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
}

.auth-card-head {
  margin-bottom: 16px;
}

.auth-title {
  margin: 0;
  color: #111827;
  font-size: 28px;
  letter-spacing: 0;
}

.auth-sub {
  margin-top: 8px;
  margin-bottom: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 2px;
}

.auth-login-password-field {
  position: relative;
  display: block;
}

.auth-login-password-field input {
  padding-right: 48px;
}

.auth-login-password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-login-password-toggle:hover,
.auth-login-password-toggle:focus-visible {
  color: #0f766e;
  background: #ecf8f5;
}

.auth-login-password-toggle:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 1px;
}

.auth-login-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-login-eye-slash {
  opacity: 0;
}

.auth-login-password-toggle.is-visible .auth-login-eye-slash {
  opacity: 1;
}

.auth-login-remember {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.auth-login-remember[hidden] {
  display: none;
}

.auth-login-remember input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: #16a34a;
}

.auth-submit-row {
  display: flex;
  justify-content: stretch;
  margin-top: 16px;
}

.auth-submit-row button {
  width: 100%;
  min-height: 42px;
}

.auth-quick-setup {
  margin-top: 12px;
}

.auth-quick-setup-link {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-card-register .auth-submit-row {
  margin-top: 20px;
}

.auth-switch {
  margin-top: 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .auth-card-product {
    width: 100%;
    margin-left: 0;
  }

  .auth-stage-grid,
  .auth-stage-grid-compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-stage,
  .auth-card-product {
    border-radius: 16px;
  }

  .auth-stage {
    padding: 20px;
  }

  .auth-card-product {
    padding: 20px;
  }

  .auth-stage-title {
    font-size: 32px;
  }
}

/* Compact account management: role switcher, business metrics, and icon actions. */
.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;
}

.page-admin #secUsers {
  gap: 12px;
}

.page-admin #secUsers > .section-head {
  padding-bottom: 10px;
}

.page-admin .admin-account-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 3px;
  margin: 0 16px;
  padding: 3px;
  background: #eaf1ef;
  border: 1px solid #d4e2de;
  border-radius: 999px;
}

.page-admin .admin-account-tab {
  gap: 7px;
  min-height: 34px;
  padding: 6px 13px;
  color: #51635f;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
}

.page-admin .admin-account-tab strong {
  min-width: 20px;
  padding: 1px 6px;
  color: #60736e;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.page-admin .admin-account-tab:hover {
  color: #0a6f70;
  background: rgba(255, 255, 255, 0.56);
}

.page-admin .admin-account-tab.is-active {
  color: #ffffff;
  background: var(--admin-teal-dark);
}

.page-admin .admin-account-tab.is-active strong {
  color: var(--admin-teal-dark);
  background: #ffffff;
}

.page-admin #secUsers .admin-compose-shell {
  padding: 12px 14px;
}

.page-admin .admin-user-create-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) minmax(130px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
}

.page-admin .admin-user-create-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.page-admin .admin-user-create-field > span {
  color: var(--admin-ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.page-admin .admin-user-create-field input {
  width: 100%;
}

.page-admin .admin-user-balance-field[hidden],
.page-admin .admin-pending-count[hidden] {
  display: none;
}

.page-admin .admin-create-user-button {
  gap: 7px;
  min-width: 150px;
  white-space: nowrap;
}

.page-admin .admin-create-user-button svg,
.page-admin .admin-user-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-admin #secUsers .admin-table-shell {
  padding: 0;
}

.page-admin .admin-user-table {
  width: 100%;
  min-width: 1220px;
  table-layout: fixed;
}

.page-admin .admin-user-table th,
.page-admin .admin-user-table td {
  width: auto;
  padding: 9px 10px;
  vertical-align: middle;
}

.page-admin .admin-user-table th:nth-child(1) { width: 17%; }
.page-admin .admin-user-table th:nth-child(2) { width: 17%; }
.page-admin .admin-user-table th:nth-child(3) { width: 9%; }
.page-admin .admin-user-table th:nth-child(4) { width: 9%; }
.page-admin .admin-user-table th:nth-child(5),
.page-admin .admin-user-table th:nth-child(6),
.page-admin .admin-user-table th:nth-child(7) { width: 8%; text-align: center; }
.page-admin .admin-user-table th:nth-child(8) { width: 9%; text-align: right; }

.page-admin .admin-user-account-cell strong,
.page-admin .admin-user-account-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin .admin-user-account-cell strong {
  color: var(--admin-ink);
  font-size: 13px;
}

.page-admin .admin-user-account-cell span {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-user-company-cell {
  overflow: hidden;
  color: var(--admin-ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin .admin-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
}

.page-admin .admin-user-badge-customer { color: #12638c; background: #e7f4fb; border-color: #b9ddef; }
.page-admin .admin-user-badge-admin { color: #8c3f2f; background: #fff0eb; border-color: #f4c7ba; }
.page-admin .admin-user-badge-enabled { color: #176b4d; background: #e8f7ef; border-color: #b8e1ca; }
.page-admin .admin-user-badge-pending { color: #8a5a08; background: #fff6dc; border-color: #efd493; }
.page-admin .admin-user-badge-disabled { color: #a23737; background: #fff0f0; border-color: #efc2c2; }
.page-admin .admin-user-badge-rejected { color: #59636d; background: #f1f3f5; border-color: #d7dde2; }
.page-admin .admin-user-badge-locked { color: #a23737; background: #fff0f0; border-color: #efc2c2; }
.page-admin .admin-user-badge-archived { color: #713f12; background: #fff7d6; border-color: #e6c85b; }
.page-admin .admin-user-badge-deleted { color: #713f12; background: #fff7d6; border-color: #e6c85b; }

.page-admin .admin-user-stat-cell,
.page-admin .admin-user-balance-cell {
  color: var(--admin-ink);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.page-admin .admin-user-balance-cell {
  text-align: right;
}

.page-admin .admin-user-auth-cell {
  display: grid;
  gap: 5px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-user-auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.page-admin .admin-user-auth-cell .admin-user-badge {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 15px;
}

.page-admin .admin-user-table th:last-child,
.page-admin .admin-user-table td:last-child {
  width: 164px;
  min-width: 164px;
}

.page-admin .admin-user-table td.admin-user-actions {
  display: flex;
  grid-template-columns: none;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
}

.page-admin .admin-user-table td:last-child .admin-user-icon-button {
  inline-size: 32px;
  block-size: 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}

.page-admin .admin-user-action-label {
  display: inline;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.page-admin .admin-user-icon-button.is-danger {
  color: #a33a3a;
}

.page-admin .admin-user-icon-button.is-danger:hover {
  color: #ffffff;
  background: #c64b4b;
  border-color: #c64b4b;
}

.page-admin .admin-user-empty {
  height: 96px;
  color: var(--admin-muted);
  text-align: center;
}

@media (max-width: 980px) {
  .page-admin .admin-user-create-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .admin-create-user-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-admin .admin-account-tabs {
    display: flex;
    width: calc(100% - 28px);
    margin-inline: 14px;
  }

  .page-admin .admin-account-tab {
    flex: 1 1 50%;
  }

  .page-admin .admin-user-create-row {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-user-table {
    min-width: 790px;
  }

  .page-admin .admin-user-table th:nth-child(2),
  .page-admin .admin-user-table td:nth-child(2) {
    display: none;
  }

  .page-admin .admin-user-table th:last-child,
  .page-admin .admin-user-table td:last-child {
    position: sticky;
    right: 0;
    width: 140px;
    min-width: 140px;
    background: #ffffff;
    box-shadow: -8px 0 12px rgba(22, 44, 39, 0.05);
  }

  .page-admin .admin-user-table th:last-child {
    background: #eef6f3;
  }

  .page-admin .admin-user-table td:last-child .admin-user-icon-button {
    inline-size: 40px;
    block-size: 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

body.page-admin {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(180deg, #edf2f6 0%, #f8fafc 46%, #eff3f7 100%);
  font-family: "Avenir Next", "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
}

.page-admin .layout.admin-layout {
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1560px;
  margin: 0 auto;
  gap: 24px;
  padding: 20px;
}

.page-admin .sidebar {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(210, 218, 228, 0.92);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 18px;
  gap: 18px;
  min-width: 0;
}

.page-admin .brand {
  padding: 16px;
  border: 1px solid #e4ebf2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
}

.page-admin .brand h1 {
  font-size: 18px;
  line-height: 1.3;
}

.page-admin .admin-rail-note {
  padding: 16px 16px 15px;
}

.page-admin .admin-rail-note-title {
  margin: 8px 0 10px;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.page-admin .nav {
  gap: 2px;
}

.page-admin .nav button {
  min-height: 0;
  padding: 13px 4px;
  border: 0;
  border-bottom: 1px solid #e8edf2;
  border-radius: 0;
  background: transparent;
  color: #526072;
}

.page-admin .nav button:hover {
  background: transparent;
  border-color: #d7dfe8;
  color: #0f172a;
}

.page-admin .nav button.is-active {
  color: #0f172a;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border: 1px solid #d6dee7;
  border-radius: 10px;
  padding-left: 14px;
  padding-right: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  position: relative;
}

.page-admin .nav button.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.page-admin .section-head {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e8edf2;
}

.page-admin .section-head h2,
.page-admin .section-head h3 {
  margin-bottom: 6px;
}

.page-admin .section-head .meta {
  max-width: 720px;
  line-height: 1.65;
}

.page-admin .admin-sidebar-actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e8edf2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.page-admin .main {
  gap: 20px;
  min-width: 0;
}

.page-admin .admin-page-view {
  display: none;
}

.page-admin .admin-page-view.is-active {
  display: block;
}

.page-admin .card,
.page-admin .admin-page-title,
.page-admin .sidebar,
.page-admin .admin-rail-note,
.page-admin .brand {
  border-radius: 18px;
}

.page-admin .sidebar {
  padding: 18px;
  gap: 16px;
}

.page-admin .brand {
  padding: 18px 18px 16px;
}

.page-admin .brand h1 {
  font-size: 18px;
}

.page-admin .admin-rail-note {
  padding: 16px 16px 15px;
}

.page-admin .admin-nav {
  gap: 8px;
}

.page-admin .admin-nav button {
  min-height: 0;
  padding: 11px 14px;
  border-radius: 12px;
}

.page-admin .admin-sidebar-actions {
  gap: 12px;
}

.page-admin .admin-page-title {
  display: flex;
  padding: 2px 2px 2px;
  align-items: flex-start;
  gap: 18px;
}

.page-admin .page-title-copy {
  display: block;
  max-width: 680px;
  padding: 6px 0 4px;
}

.page-admin .admin-top-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-admin .admin-top-actions button {
  min-width: 132px;
}

.page-admin .admin-console-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  text-decoration: none;
}

.page-admin .admin-sidebar-actions .admin-console-link {
  width: 100%;
}

.page-admin .admin-overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: min(100%, 540px);
  align-self: flex-start;
}

.page-admin .overview-pod {
  display: grid;
  align-content: space-between;
  min-height: 84px;
  padding: 14px 15px;
  border-radius: 16px;
}

.page-admin .overview-value {
  margin-top: 8px;
  font-size: 24px;
}

.page-admin .task-summary-shell,
.page-admin .admin-compose-shell,
.page-admin .admin-table-shell,
.page-admin .task-toolbar {
  padding: 16px;
  border: 1px solid #e3e8ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbfd, #f7f9fb);
  min-width: 0;
}

.page-admin .task-stack {
  display: grid;
  gap: 14px;
}

.page-admin .task-summary,
.page-admin .overview-summary {
  margin-top: 0;
  gap: 12px;
}

.page-admin .task-kpi {
  min-height: 118px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e1e7ee;
  background: #ffffff;
}

.page-admin .admin-user-grid,
.page-admin .admin-config-grid {
  align-items: start;
  gap: 16px;
}

.page-admin .admin-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.page-admin .admin-runtime-stack {
  display: grid;
  gap: 16px;
}

.page-admin .admin-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.page-admin .admin-runtime-grid-models {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-admin .admin-runtime-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

.page-admin .admin-config-card,
.page-admin .account-grid > div {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fbfcfd;
}

.page-admin .admin-runtime-panel {
  display: grid;
  gap: 16px;
}

.page-admin .admin-runtime-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-admin .overview-value-small {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.page-admin .admin-runtime-card {
  min-width: 0;
  padding: 16px 16px 15px;
}

.page-admin .admin-runtime-card-hero {
  padding-top: 15px;
}

.page-admin .admin-runtime-card-compact {
  padding-bottom: 14px;
}

.page-admin .admin-runtime-card .small {
  margin-bottom: 12px;
  line-height: 1.6;
}

.page-admin .admin-runtime-card label {
  margin-top: 6px;
}

.page-admin .admin-runtime-card input,
.page-admin .admin-runtime-card select,
.page-admin .admin-runtime-card textarea {
  padding: 10px 12px;
}

.page-admin .admin-runtime-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.page-admin .admin-runtime-block .small {
  margin-bottom: 12px;
  line-height: 1.6;
}

.page-admin .admin-runtime-block label {
  margin-top: 6px;
}

.page-admin .admin-runtime-block input,
.page-admin .admin-runtime-block select,
.page-admin .admin-runtime-block textarea {
  padding: 10px 12px;
}

.page-admin .admin-runtime-block .grid-2 {
  gap: 12px;
}

.page-admin .admin-runtime-block .grid-2 + .grid-2,
.page-admin .admin-runtime-block label + .grid-2 {
  margin-top: 8px;
}

.page-admin .admin-runtime-subblock {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.page-admin .remote-comfy-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.page-admin .remote-comfy-toolbar button.is-loading,
.page-admin .admin-runtime-panel-head button.is-loading,
.page-admin #btnSentimentCookieRefresh.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: wait;
  opacity: 0.84;
}

.page-admin .remote-comfy-toolbar button.is-loading::before,
.page-admin .admin-runtime-panel-head button.is-loading::before,
.page-admin #btnSentimentCookieRefresh.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: remote-comfy-spin 0.8s linear infinite;
}

@keyframes remote-comfy-spin {
  to {
    transform: rotate(360deg);
  }
}

.page-admin .remote-comfy-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  line-height: 1.7;
}

.page-admin .remote-comfy-status.is-running {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.page-admin .remote-comfy-status.is-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.page-admin .remote-comfy-status.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.page-admin .remote-comfy-status-title {
  font-weight: 800;
  color: inherit;
}

.page-admin .remote-comfy-status-list {
  margin-top: 4px;
}

.page-admin .remote-comfy-mapping-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.page-admin .remote-comfy-map-row {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.page-admin .remote-comfy-map-row label {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.page-admin .remote-comfy-map-row select {
  width: 100%;
  min-width: 0;
}

.page-admin .admin-config-card-title {
  margin-bottom: 10px;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.page-admin .admin-runtime-card .admin-config-card-title {
  min-height: 20px;
  margin-bottom: 12px;
}

.page-admin .admin-config-card .grid-2 + .grid-2,
.page-admin .admin-config-card label + .grid-2 {
  margin-top: 10px;
}

.page-admin .admin-runtime-card .grid-2 {
  gap: 12px;
}

.page-admin .admin-runtime-card .grid-2 + .grid-2,
.page-admin .admin-runtime-card label + .grid-2 {
  margin-top: 8px;
}

.page-admin .admin-runtime-card .switch {
  margin-top: 2px;
}

.page-admin .admin-model-list-editor {
  display: grid;
  gap: 10px;
}

.page-admin .admin-model-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.page-admin .admin-model-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}

.page-admin .admin-model-tab.is-active {
  border-color: #dbe4f0;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 -1px 0 #ffffff inset;
}

.page-admin .admin-model-tab-panels {
  display: block;
}

.page-admin .admin-model-tab-panel {
  display: none;
}

.page-admin .admin-model-tab-panel.is-active {
  display: grid;
  gap: 12px;
}

.page-admin .admin-content-model-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.page-admin .admin-content-model-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}

.page-admin .admin-content-model-tab.is-active {
  border-color: #159266;
  background: #ecfdf5;
  color: #047857;
}

.page-admin .admin-content-model-panel {
  display: none;
}

.page-admin .admin-content-model-panel.is-active {
  display: grid;
  gap: 10px;
}

.page-admin .admin-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.page-admin .admin-secret-row input {
  min-width: 0;
}

.page-admin .admin-provider-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.page-admin .admin-provider-key-row > .sensitive-input-wrap {
  min-width: 0;
}

.page-admin .admin-secret-row-with-check {
  grid-template-columns: minmax(0, 1fr) auto;
}

.page-admin .admin-secret-row-with-check > .sensitive-input-wrap {
  min-width: 0;
}

.page-admin .admin-provider-key-check {
  min-width: 92px;
  white-space: nowrap;
}

.page-admin .admin-provider-key-status:empty,
.page-admin .admin-runninghub-key-status:empty {
  display: none;
}

.page-admin .secret-toggle {
  min-height: 48px;
  padding: 0;
}

.page-admin .admin-runninghub-slot-tabs {
  margin-top: 16px;
}

.page-admin .admin-runninghub-slot-panel {
  display: none;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.page-admin .admin-runninghub-slot-panel.is-active {
  display: grid;
  gap: 10px;
}

.page-admin .admin-runninghub-slot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.page-admin .admin-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 20px;
}

.page-admin .admin-model-priority-list {
  display: grid;
  gap: 8px;
  min-height: 20px;
}

.page-admin .admin-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d7dfe8;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.2;
}

.page-admin .admin-model-chip-remove {
  min-width: 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.page-admin .admin-model-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-admin .admin-model-chip-order {
  min-width: 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.page-admin .admin-model-list-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.page-admin .admin-model-list-input-row-picker {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.page-admin .admin-model-picker-btn {
  height: 40px;
  white-space: nowrap;
}

.page-admin .admin-model-picker {
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.page-admin .admin-model-picker-search {
  width: 100%;
  margin-bottom: 8px;
  min-height: 36px;
  font-size: 13px;
}

.page-admin .admin-model-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.page-admin .admin-model-picker-count {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.page-admin .admin-model-picker-vendor {
  min-height: 36px;
  font-size: 13px;
}

.page-admin .admin-model-picker-options {
  display: grid;
  gap: 4px;
}

.page-admin .admin-model-picker-status {
  padding: 8px 10px;
  color: #64748b;
  font-size: 13px;
}

.page-admin .admin-model-picker-status.error {
  color: #b91c1c;
}

.page-admin .admin-model-picker-option {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  margin: 0;
  border-radius: 6px;
  text-align: left;
}

.page-admin .admin-model-picker-option + .admin-model-picker-option {
  margin-top: 4px;
}

.page-admin .sensitive-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.page-admin .sensitive-input-wrap .sensitive-input {
  width: 100%;
  padding-right: 34px;
}

.page-admin button.sensitive-toggle-btn,
.page-admin .sensitive-toggle-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.page-admin button.sensitive-toggle-btn:hover,
.page-admin .sensitive-toggle-btn:hover {
  color: #0f172a;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.page-admin input.is-saved-runtime-secret {
  color: #334155;
  letter-spacing: 0.14em;
}

.page-admin .sensitive-eye-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.page-admin .admin-model-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.7);
  color: #475569;
}

.page-admin .admin-model-add-btn {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.page-admin .workflow-chain-editor {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.page-admin .workflow-chain-editor:first-of-type {
  margin-top: 12px;
}

.page-admin .workflow-chain-head label {
  margin: 0;
  font-weight: 700;
  color: #1f2937;
}

.page-admin .workflow-chain-list {
  display: grid;
  gap: 8px;
}

.page-admin .workflow-step-item {
  display: grid;
  gap: 8px;
}

.page-admin .workflow-step-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.page-admin .workflow-step-row-with-type {
  grid-template-columns: auto minmax(118px, 150px) minmax(0, 1fr) auto;
}

.page-admin .workflow-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 9px 10px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.page-admin .workflow-step-actions {
  display: inline-flex;
  gap: 8px;
}

.page-admin .workflow-step-type {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.page-admin .workflow-step-value {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.page-admin .workflow-step-btn {
  min-width: 40px;
  padding: 9px 0;
  font-size: 16px;
  line-height: 1;
}

.page-admin .workflow-step-sep {
  padding-left: 20px;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 800;
}

.page-admin .table-wrap {
  border-radius: 14px;
  border-color: #e3e8ee;
  background: #ffffff;
  max-width: 100%;
  min-width: 0;
}

.page-admin .admin-user-table {
  margin-top: 0;
  min-width: 1040px;
  width: max(100%, 1040px);
}

.page-admin .table td {
  background: #ffffff;
}

.page-admin .sentiment-cookie-table {
  min-width: 980px;
  table-layout: auto;
}

.page-admin .sentiment-cookie-table th,
.page-admin .sentiment-cookie-table td {
  width: auto;
  vertical-align: top;
}

.page-admin .sentiment-cookie-table td {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.page-admin .sentiment-cookie-table th:nth-child(1),
.page-admin .sentiment-cookie-table td:nth-child(1) {
  width: 16%;
}

.page-admin .sentiment-cookie-table th:nth-child(2),
.page-admin .sentiment-cookie-table td:nth-child(2) {
  width: 30%;
}

.page-admin .sentiment-cookie-table th:nth-child(3),
.page-admin .sentiment-cookie-table td:nth-child(3),
.page-admin .sentiment-cookie-table th:nth-child(4),
.page-admin .sentiment-cookie-table td:nth-child(4),
.page-admin .sentiment-cookie-table th:nth-child(5),
.page-admin .sentiment-cookie-table td:nth-child(5) {
  width: 11%;
}

.page-admin .sentiment-cookie-table th:nth-child(6),
.page-admin .sentiment-cookie-table td:nth-child(6) {
  width: 14%;
}

.page-admin .sentiment-cookie-table th:nth-child(7),
.page-admin .sentiment-cookie-table td:nth-child(7) {
  width: 7%;
}

.page-admin .task-toolbar {
  background: #fbfcfd;
}

.page-admin .task-card {
  border-radius: 14px;
  border-color: #e1e7ee;
  background: #ffffff;
}

.page-admin .task-card-title {
  font-size: 16px;
}

.page-admin .task-card-grid {
  gap: 12px;
}

.page-admin .admin-task-modal {
  border-radius: 18px;
}

.page-admin .modal-card-narrow {
  border-radius: 18px;
}

@media (max-width: 1180px) {
  .page-admin .layout.admin-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px;
  }

  .page-admin .sidebar {
    position: static;
    top: auto;
    height: auto;
  }

  .page-admin .admin-page-title,
  .page-admin .admin-overview-strip,
  .page-admin .admin-config-grid,
  .page-admin .admin-runtime-grid,
  .page-admin .admin-runtime-grid-models {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-runtime-column {
    gap: 16px;
  }

  .page-admin .admin-page-title {
    display: grid;
  }

  .page-admin .admin-sidebar-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-admin .admin-page-title h2 {
    font-size: 28px;
  }

  .page-admin .section,
  .page-admin .card,
  .page-admin .task-summary-shell,
  .page-admin .admin-compose-shell,
  .page-admin .admin-table-shell,
  .page-admin .task-toolbar,
  .page-admin .admin-config-card {
    border-radius: 14px;
  }

  .page-admin .overview-value {
    font-size: 20px;
  }

}

.persona-dashboard-page {
  display: grid;
  gap: 16px;
}

.persona-public-shell {
  width: min(1680px, 100%);
}

.persona-dashboard-hero,
.persona-dashboard-filters,
.persona-chart-panel,
.persona-dashboard-note,
.persona-workbench-panel {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-out);
}

.persona-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 16px;
}

.persona-dashboard-hero h2 {
  margin: 2px 0 6px;
  font-size: 28px;
}

.persona-dashboard-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 190px;
}

.persona-dashboard-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
}

.persona-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.persona-kpi {
  min-height: 104px;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.persona-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.persona-chart-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: 14px;
}

.persona-chart-panel-wide {
  grid-column: span 2;
}

.persona-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.persona-chart-head h3,
.persona-list-head h3 {
  margin: 0;
  font-size: 18px;
}

.persona-chart {
  min-height: 210px;
  min-width: 0;
}

.persona-chart-tall {
  min-height: 250px;
}

.persona-chart-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.42);
  border-radius: 12px;
}

.persona-bar-list {
  display: grid;
  gap: 10px;
}

.persona-bar-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(180px, 2fr) 82px;
  gap: 10px;
  align-items: center;
}

.persona-bar-label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.persona-bar-label span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.persona-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.persona-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #f59e0b);
}

.persona-bar-value {
  text-align: right;
  font-weight: 900;
  color: #0f172a;
}

.persona-donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.persona-donut {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.persona-donut > div {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.persona-donut strong {
  font-size: 18px;
}

.persona-donut span {
  color: var(--muted);
  font-size: 12px;
}

.persona-donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.persona-donut-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #334155;
}

.persona-donut-legend span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.persona-donut-legend b {
  color: #0f172a;
}

.persona-line-chart {
  width: 100%;
  height: 230px;
}

.persona-line-chart text {
  fill: #64748b;
  font-size: 11px;
}

.persona-axis {
  stroke: rgba(100, 116, 139, 0.35);
  stroke-width: 1;
}

.persona-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.persona-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-weight: 800;
}

.persona-line-legend i {
  width: 20px;
  height: 4px;
  border-radius: 999px;
}

.persona-dashboard-note {
  padding: 12px 14px;
  border-radius: 12px;
  color: #334155;
}

.persona-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.persona-person-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.persona-workbench-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
}

.persona-overview-pane {
  display: grid;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 760px) {
}

@keyframes mobile-tweet-stream-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
}

@media (max-width: 1180px) {
  .persona-dashboard-filters,
  .persona-chart-grid,
  .persona-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .persona-chart-panel-wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .persona-dashboard-hero,
  .persona-chart-head {
    display: grid;
  }

  .persona-dashboard-actions {
    justify-items: start;
  }

  .persona-dashboard-filters,
.persona-chart-grid,
.persona-kpi-grid,
.persona-person-layout {
    grid-template-columns: 1fr;
  }

  .persona-chart-panel-wide {
    grid-column: span 1;
  }

  .persona-bar-row {
    grid-template-columns: minmax(168px, 1.1fr) minmax(90px, 1.4fr) 64px;
    gap: 8px;
  }

  .persona-bar-value {
    text-align: right;
    font-size: 12px;
  }

  .persona-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* Vecto operations visual system shared by admin surfaces. */
body.page-admin {
  --admin-ink: #071314;
  --admin-ink-soft: #31464a;
  --admin-muted: #65787b;
  --admin-paper: #ffffff;
  --admin-surface: #f4f7f6;
  --admin-line: #d7e2df;
  --admin-teal: #0c9a9a;
  --admin-teal-dark: #087071;
  --admin-success-accent: #356b91;
  --admin-coral: #e75d4f;
  background: var(--admin-surface);
  color: var(--admin-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
  line-height: 1.6;
}

.page-admin .layout.admin-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  width: calc(100% - 24px);
  max-width: none;
  gap: 16px;
  padding: 12px 0 24px;
}

.page-admin .sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px;
  gap: 10px;
  color: rgba(246, 255, 252, 0.84);
  background: #071112;
  border: 1px solid #17383a;
  border-radius: 8px;
  box-shadow: none;
  scrollbar-color: #3d6967 transparent;
}

.page-admin .brand,
.page-admin .admin-rail-note {
  padding: 10px;
  color: inherit;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(218, 255, 243, 0.13);
  border-radius: 8px;
  box-shadow: none;
}

.page-admin .admin-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-admin .admin-brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid rgba(218, 255, 243, 0.22);
  border-radius: 7px;
  background: #041210;
}

.page-admin .admin-brand-eyebrow,
.page-admin .section-kicker {
  color: #9ff7d1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-admin .brand h1 {
  margin: 1px 0 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.page-admin .brand p,
.page-admin .small,
.page-admin .meta {
  color: var(--admin-muted);
}

.page-admin .brand p,
.page-admin .sidebar .small {
  color: rgba(237, 255, 249, 0.65);
}

.page-admin .admin-rail-note-title,
.page-admin .admin-rail-status-title {
  color: #f6fffc;
}

.page-admin .admin-rail-note-title {
  margin: 6px 0 8px;
  font-size: 14px;
  line-height: 1.5;
}

.page-admin .admin-nav {
  gap: 4px;
}

.page-admin .admin-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 7px 10px;
  color: rgba(237, 255, 249, 0.72);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.page-admin .admin-nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(218, 255, 243, 0.12);
}

.page-admin .admin-nav button.is-active {
  padding: 7px 10px 7px 13px;
  color: #ffffff;
  background: rgba(12, 154, 154, 0.2);
  border-color: rgba(117, 241, 211, 0.3);
  border-radius: 7px;
  box-shadow: none;
}

.page-admin .admin-nav button.is-active::before {
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--admin-success-accent);
}

.page-admin .admin-sidebar-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding-top: 10px;
  border-top-color: rgba(218, 255, 243, 0.13);
}

.page-admin .admin-sidebar-actions > a,
.page-admin .admin-sidebar-actions > button {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13px;
  white-space: normal;
}

.page-admin .main {
  gap: 14px;
}

.page-admin .card,
.page-admin .admin-page-view {
  border-radius: 8px;
}

.page-admin .admin-page-title {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  overflow: hidden;
  padding: 18px;
  color: #ffffff;
  background: #071112 url("/assets/opc/vecto-ai-cockpit.png") center / cover no-repeat;
  border: 1px solid #17383a;
  border-radius: 8px;
  box-shadow: none;
}

.page-admin .admin-page-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(4, 18, 16, 0.82);
}

.page-admin .page-title-copy {
  max-width: 640px;
  padding: 0;
}

.page-admin .admin-page-title h2 {
  margin: 5px 0 8px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-admin .admin-page-title .meta {
  color: rgba(241, 255, 250, 0.76);
}

.page-admin .admin-top-actions {
  gap: 6px;
  margin-top: 12px;
}

.page-admin .admin-top-actions > a,
.page-admin .admin-top-actions > button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13px;
}

.page-admin .admin-top-actions .ghost {
  color: #effff9;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(218, 255, 243, 0.23);
}

.page-admin .admin-top-actions .ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.page-admin .admin-overview-strip {
  align-self: stretch;
  min-width: 0;
  gap: 8px;
}

.page-admin .overview-pod {
  min-height: 64px;
  padding: 9px 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(218, 255, 243, 0.16);
  border-radius: 7px;
}

.page-admin .overview-label {
  color: rgba(238, 255, 249, 0.66);
  font-size: 12px;
}

.page-admin .overview-value {
  margin-top: 6px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.page-admin .card {
  padding: 16px;
  background: var(--admin-paper);
  border: 1px solid var(--admin-line);
  box-shadow: none;
}

.page-admin .section-head {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom-color: var(--admin-line);
}

.page-admin .section-head h2,
.page-admin .section-head h3 {
  margin-bottom: 4px;
  color: var(--admin-ink);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-admin .task-summary-shell,
.page-admin .admin-compose-shell,
.page-admin .admin-table-shell,
.page-admin .task-toolbar,
.page-admin .admin-config-card,
.page-admin .account-grid > div,
.page-admin .admin-runtime-block {
  padding: 12px;
  background: #f8fbfa;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  box-shadow: none;
}

.page-admin .task-summary,
.page-admin .overview-summary,
.page-admin .admin-user-grid,
.page-admin .admin-config-grid,
.page-admin .admin-runtime-grid,
.page-admin .admin-runtime-stack,
.page-admin .admin-runtime-column,
.page-admin .task-stack {
  gap: 10px;
}

.page-admin .task-kpi {
  min-height: 84px;
  padding: 12px;
  background: #ffffff;
  border-color: var(--admin-line);
  border-radius: 8px;
  box-shadow: none;
}

.page-admin .task-kpi .num,
.page-admin .kpi .num {
  color: var(--admin-ink);
}

.page-admin input,
.page-admin select,
.page-admin textarea {
  min-height: 40px;
  color: var(--admin-ink);
  background: #ffffff;
  border-color: var(--admin-line);
  border-radius: 7px;
  box-shadow: none;
}

.page-admin textarea {
  min-height: 108px;
}

.page-admin input:focus,
.page-admin select:focus,
.page-admin textarea:focus {
  border-color: var(--admin-teal);
  box-shadow: 0 0 0 3px rgba(12, 154, 154, 0.12);
}

.page-admin button,
.page-admin .btn {
  border-radius: 7px;
  box-shadow: none;
}

.page-admin button.primary,
.page-admin .btn.primary {
  color: #ffffff;
  background: var(--admin-teal);
  border-color: var(--admin-teal);
}

.page-admin button.primary:hover,
.page-admin .btn.primary:hover {
  background: var(--admin-teal-dark);
  border-color: var(--admin-teal-dark);
}

.page-admin button.ghost,
.page-admin .btn.ghost {
  color: var(--admin-ink-soft);
  background: #ffffff;
  border-color: var(--admin-line);
}

.page-admin button.ghost:hover,
.page-admin .btn.ghost:hover {
  color: var(--admin-teal-dark);
  background: #f2faf7;
  border-color: #9fd4c8;
}

.page-admin button.blue,
.page-admin .btn.blue {
  color: #ffffff;
  background: var(--admin-teal-dark);
  border-color: var(--admin-teal-dark);
}

.page-admin button.danger,
.page-admin .btn.danger {
  color: #ffffff;
  background: var(--admin-coral);
  border-color: var(--admin-coral);
}

.page-admin .table-wrap {
  border-radius: 8px;
}

.page-admin .table th {
  color: var(--admin-ink-soft);
  background: #eef6f3;
  border-bottom-color: var(--admin-line);
  font-size: 12px;
}

.page-admin .table td {
  border-bottom-color: #e7efec;
}

.page-admin .table tr:hover td {
  background: #f6fbf9;
}

.page-admin .admin-task-table-shell {
  margin-top: 10px;
  padding: 0;
  overflow-x: auto;
  background: #ffffff;
}

.page-admin .admin-task-table {
  width: 100%;
  min-width: 1180px;
  margin: 0;
  table-layout: fixed;
}

.page-admin .admin-task-table th,
.page-admin .admin-task-table td {
  width: auto;
  padding: 11px 12px;
  vertical-align: middle;
  white-space: normal;
}

.page-admin .admin-task-table th:nth-child(1),
.page-admin .admin-task-table td:nth-child(1) {
  width: 17%;
}

.page-admin .admin-task-table th:nth-child(2),
.page-admin .admin-task-table td:nth-child(2) {
  width: 22%;
}

.page-admin .admin-task-table th:nth-child(3),
.page-admin .admin-task-table td:nth-child(3) {
  width: 9%;
}

.page-admin .admin-task-table th:nth-child(4),
.page-admin .admin-task-table td:nth-child(4) {
  width: 8%;
}

.page-admin .admin-task-table th:nth-child(5),
.page-admin .admin-task-table td:nth-child(5) {
  width: 11%;
}

.page-admin .admin-task-table th:nth-child(6),
.page-admin .admin-task-table td:nth-child(6) {
  width: 7%;
}

.page-admin .admin-task-table th:nth-child(7),
.page-admin .admin-task-table td:nth-child(7) {
  width: 14%;
}

.page-admin .admin-task-table th:nth-child(8),
.page-admin .admin-task-table td:nth-child(8) {
  width: 12%;
}

.page-admin .admin-task-table td > strong,
.page-admin .admin-task-table td > span,
.page-admin .admin-task-table td > time {
  display: block;
  min-width: 0;
}

.page-admin .admin-task-table td > strong,
.page-admin .admin-task-table td > time {
  color: var(--admin-ink);
  font-weight: 800;
}

.page-admin .admin-task-table td > span,
.page-admin .admin-task-table td > time + span {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.4;
}

.page-admin .admin-task-prompt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  color: var(--admin-ink) !important;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.page-admin .admin-task-error {
  overflow: hidden;
  color: #a92934 !important;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.page-admin .admin-task-table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-admin .admin-task-table-actions .task-action-btn {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 18px;
}

.page-admin .admin-model-tab,
.page-admin .admin-content-model-tab,
.page-admin .admin-runninghub-slot-tab,
.page-admin .workflow-step-item,
.page-admin .admin-model-chip,
.page-admin .modal-card {
  border-radius: 7px;
}

@media (max-width: 1180px) {
  .page-admin .layout.admin-layout {
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    max-width: none;
    padding-top: 12px;
  }

  .page-admin .sidebar {
    position: static;
    max-height: none;
  }

  .page-admin .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .admin-page-title {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-overview-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-admin .layout.admin-layout {
    width: calc(100% - 16px);
    max-width: none;
    gap: 16px;
    padding-bottom: 20px;
  }

  .page-admin .sidebar,
  .page-admin .card,
  .page-admin .admin-page-title {
    padding: 16px;
  }

  .page-admin .admin-nav,
  .page-admin .admin-overview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .page-admin .admin-page-title h2 {
    font-size: 27px;
  }

  .page-admin .admin-top-actions,
  .page-admin .section-head-side,
  .page-admin .task-inline-actions {
    align-items: stretch;
  }

  .page-admin .admin-top-actions > a,
  .page-admin .admin-top-actions > button,
  .page-admin .section-head-side > button,
  .page-admin .task-inline-actions > button {
    flex: 1 1 132px;
  }

  .page-admin .section-head h2,
  .page-admin .section-head h3 {
    font-size: 21px;
  }

  .page-admin .admin-runtime-grid,
  .page-admin .admin-runtime-grid-models,
  .page-admin .admin-config-grid {
    grid-template-columns: 1fr;
  }
}

/* Keep the active overview focused on a single KPI set and constrain dense controls. */
.page-admin .main:has(#secOverview.is-active) .admin-overview-strip {
  display: none;
}

.page-admin .main:has(#secOverview.is-active) .admin-page-title {
  grid-template-columns: 1fr;
  min-height: 184px;
}

.page-admin .row > button,
.page-admin .row > .btn {
  flex: 0 0 auto;
  min-width: 132px;
}

.page-admin .row > .msg {
  flex: 1 1 220px;
  min-width: 0;
}

.page-admin .admin-user-table th:last-child,
.page-admin .admin-user-table td:last-child {
  width: 264px;
  min-width: 264px;
  overflow: visible;
  white-space: normal;
}

.page-admin .admin-user-table td:last-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.page-admin .admin-user-table td:last-child button {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  white-space: nowrap;
}

.page-admin .admin-user-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 12px;
  background: #f8fbfa;
  border: 1px solid var(--admin-line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.page-admin .admin-user-pagination-summary,
.page-admin .admin-user-pagination-actions span {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 700;
}

.page-admin .admin-user-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-admin .admin-user-pagination-actions button {
  min-width: 76px;
}

.page-admin .admin-user-pagination-actions button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.page-admin .meta-chip,
.page-admin .meta-chip-code {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-admin .overview-summary {
  padding: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 720px) {
  .page-admin .main:has(#secOverview.is-active) .admin-page-title {
    min-height: 0;
  }

  .page-admin .row > button,
  .page-admin .row > .btn {
    width: 100%;
    min-width: 0;
  }

  .page-admin .admin-user-table th:last-child,
  .page-admin .admin-user-table td:last-child {
    width: 240px;
    min-width: 240px;
  }
}

/* Keep the runtime save action inside the runtime section instead of overlaying pages. */
.page-admin #secRuntime .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fbfa;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  box-shadow: none;
}

.page-admin #secRuntime #btnSaveRuntime {
  min-height: 40px;
  padding: 8px 16px;
  white-space: nowrap;
}

.page-admin .admin-pending-count {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 12px;
  color: var(--admin-teal-dark);
  background: #e9f8f4;
  border: 1px solid #b9ddd4;
  border-radius: 7px;
}

.page-admin .admin-pending-count strong {
  font-size: 20px;
}

.page-admin .admin-pending-count span {
  font-size: 13px;
  font-weight: 800;
}

.page-admin .admin-user-detail-modal {
  width: min(1080px, 100%);
  background: #ffffff;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
}

.page-admin .admin-user-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-admin .admin-user-detail-modal .modal-header > div:first-child,
.page-admin .admin-user-detail-modal #userDetailSub {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  .page-admin .admin-user-detail-modal .modal-header {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .page-admin .admin-user-detail-header-actions {
    width: 100%;
  }

  .page-admin .admin-user-detail-header-actions > button {
    flex: 1 1 140px;
    min-width: 0;
    white-space: normal;
  }
}

.page-admin #userDetailModal .admin-user-resource-section,
.page-admin #userBillingModal .admin-user-billing-section {
  display: grid;
  gap: 12px;
  margin: 4px 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-line);
}

.page-admin #userBillingModal .admin-user-billing-section {
  border-top: 0;
  padding-top: 0;
  margin: 0;
}

.page-admin #userDetailModal .admin-user-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.page-admin #userDetailModal .admin-user-resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #userBillingModal .admin-billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.page-admin #userBillingModal .admin-billing-summary-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #userBillingModal .admin-billing-summary-item span,
.page-admin #userBillingModal .admin-billing-summary-item strong {
  display: block;
}

.page-admin #userBillingModal .admin-billing-summary-item span {
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #userBillingModal .admin-billing-summary-item strong {
  margin-top: 4px;
  font-size: 16px;
}

.page-admin #userBillingModal .admin-billing-summary-grid {
  margin-bottom: 6px;
}

.page-admin #userBillingModal .admin-billing-user-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .78fr);
  gap: 20px;
  align-items: start;
}

.page-admin #userBillingModal .admin-billing-ledger-panel,
.page-admin #userBillingModal .admin-billing-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.page-admin #userBillingModal .admin-billing-ledger-panel {
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #ffffff;
}

.page-admin #userBillingModal .admin-billing-ledger-toolbar,
.page-admin #userBillingModal .admin-billing-ledger-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.page-admin #userBillingModal .admin-billing-ledger-toolbar strong {
  display: block;
  font-size: 14px;
}

.page-admin #userBillingModal .admin-billing-ledger-toolbar span {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #userBillingModal .admin-billing-ledger-filters {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #f5f9f8;
}

.page-admin #userBillingModal .admin-billing-ledger-filters button {
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--admin-muted);
}

.page-admin #userBillingModal .admin-billing-ledger-filters button.is-active,
.page-admin #userBillingModal .admin-billing-ledger-filters button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--admin-ink, #123);
  box-shadow: 0 0 0 1px var(--admin-line);
}

.page-admin #userBillingModal .admin-billing-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #userBillingModal .admin-billing-page-size select {
  min-width: 72px;
}

.page-admin #userBillingModal .admin-billing-ledger-table {
  overflow-x: auto;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #ffffff;
}

.page-admin #userBillingModal .admin-billing-ledger-table-head,
.page-admin #userBillingModal .admin-billing-ledger-row {
  display: grid;
  grid-template-columns: 136px minmax(220px, 1fr) 96px 132px;
  gap: 10px;
  align-items: center;
  min-width: 620px;
  min-height: 36px;
  padding: 5px 12px;
}

.page-admin #userBillingModal .admin-billing-ledger-table-head {
  border-bottom: 1px solid var(--admin-line);
  background: #f5f9f8;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 700;
}

.page-admin #userBillingModal .admin-billing-ledger-table-head span:nth-child(n + 3),
.page-admin #userBillingModal .admin-billing-ledger-amount,
.page-admin #userBillingModal .admin-billing-ledger-balance {
  text-align: right;
}

.page-admin #userBillingModal .admin-billing-ledger-row:not(:last-child) {
  border-bottom: 1px solid var(--admin-line);
}

.page-admin #userBillingModal .admin-billing-ledger-time,
.page-admin #userBillingModal .admin-billing-ledger-amount,
.page-admin #userBillingModal .admin-billing-ledger-balance {
  overflow: visible;
  white-space: nowrap;
}

.page-admin #userBillingModal .admin-billing-ledger-time {
  color: var(--admin-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.page-admin #userBillingModal .admin-billing-ledger-event {
  min-width: 0;
}

.page-admin #userBillingModal .admin-billing-ledger-event strong {
  display: block;
  overflow: visible;
  color: var(--admin-ink, #123);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.page-admin #userBillingModal .admin-billing-adjust-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.page-admin #userBillingModal .admin-billing-adjust-actions .primary,
.page-admin #userBillingModal .admin-billing-adjust-actions .ghost {
  flex: 1 1 0;
}

.page-admin #userBillingModal .admin-billing-ledger-direction {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f5f9f8;
  font-size: 13px;
}

.page-admin #userBillingModal .admin-billing-ledger-direction.is-positive,
.page-admin #userBillingModal .admin-billing-ledger-amount.is-positive {
  color: #1a7f5a;
}

.page-admin #userBillingModal .admin-billing-ledger-direction.is-negative,
.page-admin #userBillingModal .admin-billing-ledger-amount.is-negative {
  color: #b42318;
}

.page-admin #userBillingModal .admin-billing-ledger-direction.is-positive {
  background: #e8f6ef;
}

.page-admin #userBillingModal .admin-billing-ledger-direction.is-negative {
  background: #fdecec;
}

.page-admin #userBillingModal .admin-billing-ledger-amount,
.page-admin #userBillingModal .admin-billing-ledger-balance {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.page-admin #userBillingModal .admin-billing-ledger-empty {
  padding: 18px 12px;
  color: var(--admin-muted);
  text-align: center;
}

.page-admin #userBillingModal .admin-billing-subscription-panel {
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #userBillingModal .admin-billing-subscription-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.page-admin #userBillingModal .admin-billing-subscription-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
}

.page-admin #userBillingModal .admin-billing-subscription-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-admin #userBillingModal .admin-billing-subscription-meta {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #userBillingModal #billingLedgerPagination {
  margin: 0;
}

.page-admin #userDetailModal .admin-billing-table-wrap,
.page-admin #userBillingModal .admin-billing-table-wrap {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #userDetailModal .admin-billing-table,
.page-admin #userBillingModal .admin-billing-table {
  width: 100%;
}

.page-admin #userBillingModal .admin-billing-adjustment {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #userBillingModal .admin-billing-adjustment form {
  display: grid;
  gap: 14px;
}

.page-admin #userBillingModal .admin-billing-empty-panel {
  padding: 16px;
  border: 1px dashed var(--admin-line);
  border-radius: 7px;
  color: var(--admin-muted);
}

@media (max-width: 800px) {
  .page-admin #userBillingModal .admin-billing-summary-grid,
  .page-admin #userDetailModal .admin-user-resource-grid,
  .page-admin #userBillingModal .admin-billing-user-layout {
    grid-template-columns: 1fr;
  }

  .page-admin #userBillingModal .admin-billing-ledger-table-head,
  .page-admin #userBillingModal .admin-billing-ledger-row {
    min-width: 560px;
    min-height: 34px;
    padding: 4px 10px;
  }
}

.page-admin .admin-user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.page-admin .admin-user-detail-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  background: #f5f9f8;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
}

.page-admin .admin-user-detail-item span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.page-admin .admin-user-detail-item strong {
  overflow-wrap: anywhere;
  color: var(--admin-ink);
  font-size: 14px;
}

.page-admin .admin-user-detail-item-wide {
  grid-column: 1 / -1;
}

.page-admin #userApprovalNote {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.page-admin .admin-user-password-section {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  background: #f5f9f8;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
}

.page-admin .admin-user-auth-section {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  background: #f5f9f8;
  border: 1px solid var(--admin-line);
  border-left: 3px solid var(--admin-teal);
  border-radius: 7px;
}

.page-admin .admin-user-auth-section[hidden] {
  display: none;
}

.page-admin .admin-user-auth-heading,
.page-admin .admin-user-auth-email,
.page-admin .admin-user-auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-admin .admin-user-auth-heading > div,
.page-admin .admin-user-auth-email > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.page-admin .admin-user-auth-heading span,
.page-admin .admin-user-auth-email span,
.page-admin .admin-user-auth-email small,
.page-admin .admin-user-auth-method small {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-user-auth-email strong {
  overflow-wrap: anywhere;
  color: var(--admin-ink);
}

.page-admin .admin-user-auth-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.page-admin .admin-user-auth-method {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  cursor: pointer;
}

.page-admin .admin-user-auth-method:has(input:checked) {
  border-color: #75bbaa;
  box-shadow: inset 3px 0 0 var(--admin-teal);
}

.page-admin .admin-user-auth-method:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.68;
}

.page-admin .admin-user-auth-method input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.page-admin .admin-user-auth-method > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.page-admin .admin-user-auth-footer .msg {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.page-admin .admin-runtime-auth-status {
  padding: 7px 9px;
  border-left: 3px solid var(--admin-line);
  background: #f7faf9;
}

.page-admin .admin-runtime-auth-status[data-state="ready"] {
  color: #176b4d;
  border-left-color: #43a67d;
}

.page-admin .admin-runtime-auth-status[data-state="warning"],
.page-admin .admin-runtime-auth-status[data-state="unavailable"] {
  color: #8a5a08;
  border-left-color: #d69b2d;
  background: #fffaf0;
}

.page-admin .admin-cleanup-section {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin .admin-cleanup-section + .admin-cleanup-section {
  margin-top: 2px;
}

.page-admin .admin-cleanup-section-head,
.page-admin .admin-cleanup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-admin .admin-cleanup-section-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.page-admin .admin-cleanup-section-head strong {
  color: #172536;
  font-size: 14px;
}

.page-admin .admin-cleanup-section-head span,
.page-admin .admin-cleanup-actions span {
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.45;
}

.page-admin .admin-cleanup-section-head .switch {
  flex: 0 0 auto;
  margin: 0;
}

.page-admin .admin-cleanup-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.page-admin .admin-cleanup-section label {
  margin: 0;
}

.page-admin .admin-cleanup-section label > input:not([type="checkbox"]) {
  margin-top: 4px;
}

.page-admin .admin-browser-cache-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  background: #d8e0e8;
}

.page-admin .admin-browser-cache-status > div {
  min-width: 0;
  padding: 8px 9px;
  background: #f7f9fb;
}

.page-admin .admin-browser-cache-status dt {
  color: #667383;
  font-size: 11px;
}

.page-admin .admin-browser-cache-status dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #172536;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.page-admin .admin-browser-cache-run {
  flex: 0 0 auto;
  min-height: 36px;
  color: #ffffff;
  border-color: #263b4d;
  background: #263b4d;
}

.page-admin .admin-browser-cache-run:hover:not(:disabled) {
  border-color: #172b3c;
  background: #172b3c;
}

.page-admin .admin-browser-cache-run:disabled {
  opacity: 0.62;
  cursor: wait;
}

.page-admin #browserCacheCleanupMsg {
  min-height: 0;
  margin: 0;
}

@media (max-width: 700px) {
  .page-admin .admin-cleanup-section-head,
  .page-admin .admin-cleanup-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-admin .admin-cleanup-fields,
  .page-admin .admin-browser-cache-status {
    grid-template-columns: 1fr;
  }
}

.page-admin .admin-user-password-section[hidden] {
  display: none;
}

.page-admin .admin-user-password-heading,
.page-admin .admin-user-password-current,
.page-admin .admin-user-password-result {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-admin .admin-user-password-heading {
  justify-content: space-between;
}

.page-admin .admin-user-password-heading-actions,
.page-admin .admin-user-password-manual-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-admin .admin-user-password-heading-actions > button,
.page-admin .admin-user-password-manual-actions > button {
  width: auto;
  min-width: 132px;
}

.page-admin .admin-user-password-manual-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #9ccfc4;
  border-radius: 6px;
  background: #ffffff;
}

.page-admin .admin-user-password-manual-form[hidden] {
  display: none;
}

.page-admin .admin-user-password-manual-copy {
  display: grid;
  gap: 3px;
}

.page-admin .admin-user-password-manual-copy span {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-user-password-manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.page-admin .admin-user-password-manual-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.page-admin .admin-user-password-manual-grid input {
  width: 100%;
  min-width: 0;
}

.page-admin .admin-user-password-manual-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-admin .admin-user-password-manual-footer .msg {
  min-width: 0;
  margin: 0;
}

.page-admin .admin-user-password-current {
  justify-content: space-between;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--admin-line);
}

.page-admin .admin-user-password-current-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.page-admin .admin-user-password-current-copy span {
  color: var(--admin-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.page-admin .admin-user-password-current-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.page-admin .admin-user-password-current-actions button[hidden] {
  display: none;
}

.page-admin .admin-user-password-heading > div {
  display: grid;
  gap: 3px;
}

.page-admin .admin-user-password-heading span,
.page-admin .admin-user-password-result > label {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-user-password-result {
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--admin-line);
}

.page-admin .admin-user-password-result[hidden] {
  display: none;
}

.page-admin .admin-user-password-result input {
  min-width: 0;
  flex: 1;
  width: auto;
  min-height: 38px;
  color: var(--admin-ink);
  background: #ffffff;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.page-admin .admin-user-password-reveal-result input {
  border-color: #8fc8bb;
  background: #fafffd;
}

.page-admin .admin-approval-actions {
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .page-admin .admin-user-detail-grid {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-user-detail-item-wide {
    grid-column: auto;
  }

  .page-admin .admin-user-password-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin .admin-user-password-heading-actions,
  .page-admin .admin-user-password-heading-actions > button,
  .page-admin .admin-user-password-manual-actions,
  .page-admin .admin-user-password-manual-actions > button {
    width: 100%;
  }

  .page-admin .admin-user-password-manual-grid {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-user-password-manual-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin .admin-user-password-current,
  .page-admin .admin-user-password-result {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin .admin-user-password-current-actions,
  .page-admin .admin-user-password-current-actions button,
  .page-admin .admin-user-password-result button,
  .page-admin .admin-user-password-result input {
    width: 100%;
  }

  .page-admin .admin-user-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin .admin-user-pagination-actions {
    justify-content: space-between;
  }
}

.page-admin #secRuntime .row .msg {
  margin: 0;
  color: var(--admin-ink-soft);
}

@media (max-width: 720px) {
  .page-admin #secRuntime .row {
    display: grid;
    padding: 12px;
  }
}

/* Retired full-width shell kept inert for compatibility reference.
   The operational backend uses the original two-column sidebar layout. */
@media (min-width: 99999px) {
.page-admin button,
.page-admin input,
.page-admin select,
.page-admin textarea {
  font: inherit;
}

.page-admin .layout.admin-layout {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0 0 48px;
}

.page-admin .sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: auto;
  max-height: none;
  padding: 10px clamp(18px, 3.5vw, 56px);
  overflow: visible;
  border: 0;
  border-bottom: 1px solid rgba(218, 255, 243, 0.15);
  border-radius: 0;
  background: #10191f;
  backdrop-filter: none;
}

.page-admin .brand {
  padding: 0;
  border: 0;
  background: transparent;
}

.page-admin .admin-brand-mark {
  width: 36px;
  height: 36px;
}

.page-admin .brand p,
.page-admin .admin-rail-note {
  display: none;
}

.page-admin .admin-nav {
  display: flex;
  flex: 0 1 auto;
  flex-direction: row;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.page-admin .admin-nav button {
  flex: 0 0 auto;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  white-space: nowrap;
}

.page-admin .admin-nav button.is-active {
  padding: 8px 11px;
  color: #071314;
  border-color: #5de29b;
  background: #5de29b;
}

.page-admin .admin-nav button.is-active::before {
  display: none;
}

.page-admin .admin-sidebar-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
}

.page-admin .admin-sidebar-actions > a,
.page-admin .admin-sidebar-actions > button {
  width: auto;
  min-height: 38px;
  padding: 7px 11px;
  white-space: nowrap;
}

.page-admin .admin-sidebar-actions .admin-console-link {
  width: auto;
  flex: 0 0 auto;
}

.page-admin .admin-sidebar-actions .ghost {
  color: #effff9;
  border-color: rgba(218, 255, 243, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.page-admin .main {
  width: min(1480px, calc(100% - 28px));
  margin: 14px auto 0;
  gap: 14px;
}

.page-admin .admin-page-title {
  min-height: 126px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.52fr);
  padding: 18px;
}

.page-admin .admin-overview-strip {
  align-self: center;
  max-width: 380px;
  gap: 5px;
}

.page-admin .overview-pod {
  min-height: 54px;
  padding: 7px 8px;
}

.page-admin .overview-label {
  font-size: 11px;
}

.page-admin .overview-value {
  margin-top: 4px;
  font-size: 20px;
}

.page-admin .admin-page-title::before {
  background: rgba(3, 17, 15, 0.84);
}

.page-admin .admin-page-view {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.page-admin .admin-page-view > .section-head {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #ffffff;
}

.page-admin .task-summary-shell,
.page-admin .admin-compose-shell,
.page-admin .admin-table-shell,
.page-admin .task-toolbar,
.page-admin .admin-config-card,
.page-admin .account-grid > div,
.page-admin .admin-runtime-block {
  background: #ffffff;
}

.page-admin input,
.page-admin select {
  min-height: 38px;
}

.page-admin button,
.page-admin .btn {
  min-height: 36px;
}

.page-admin .secret-toggle,
.page-admin .admin-model-chip button,
.page-admin .admin-model-chip-remove,
.page-admin .admin-model-chip-order button {
  min-height: 28px;
}

.page-admin .table-wrap,
.page-admin .admin-table-shell {
  max-width: 100%;
  overflow-x: auto;
}

.page-admin .task-filter-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

@media (max-width: 1180px) {
  .page-admin .layout.admin-layout {
    width: 100%;
    padding-top: 0;
  }

  .page-admin .sidebar {
    position: sticky;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 18px 12px;
  }

  .page-admin .admin-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
  }

  .page-admin .main {
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  .page-admin .admin-page-title {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-overview-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-admin .task-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-admin .sidebar {
    padding: 9px 10px 11px;
  }

  .page-admin .brand {
    padding: 0;
  }

  .page-admin .brand h1 {
    font-size: 16px;
  }

  .page-admin .admin-sidebar-actions {
    justify-self: end;
    gap: 6px;
  }

  .page-admin .admin-sidebar-actions > a {
    display: inline-flex;
    width: auto;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .page-admin .admin-nav button {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .page-admin .main {
    width: calc(100% - 16px);
    gap: 16px;
  }

  .page-admin .admin-page-title {
    min-height: 0;
    padding: 20px 16px;
  }

  .page-admin .admin-page-view > .section-head,
  .page-admin .task-summary-shell,
  .page-admin .admin-compose-shell,
  .page-admin .admin-table-shell,
  .page-admin .task-toolbar,
  .page-admin .admin-config-card,
  .page-admin .account-grid > div,
  .page-admin .admin-runtime-block {
    padding: 14px;
  }

  .page-admin .admin-overview-strip,
  .page-admin .task-filter-grid {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-top-actions > a,
  .page-admin .admin-top-actions > button,
  .page-admin .section-head-side > button,
  .page-admin .task-inline-actions > button {
    flex: 1 1 100%;
  }
}

}

/* Unified admin control sizing. Keep dense operational actions balanced. */
.page-admin {
  --admin-control-height: 36px;
  --admin-field-height: 38px;
  --admin-compact-height: 28px;
  --admin-checkbox-size: 16px;
  --admin-control-radius: 7px;
  --admin-action-gap: 6px;
}

.page-admin button,
.page-admin .btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: var(--admin-control-height);
  padding: 7px 11px;
  border-radius: var(--admin-control-radius);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0;
  text-align: center;
}

.page-admin button:focus-visible,
.page-admin .btn:focus-visible,
.page-admin input:focus-visible,
.page-admin select:focus-visible,
.page-admin textarea:focus-visible {
  outline: 2px solid #0c9a9a;
  outline-offset: 2px;
}

.page-admin input:not([type="checkbox"]):not([type="radio"]),
.page-admin select {
  min-height: var(--admin-field-height);
}

.page-admin input[type="checkbox"],
.page-admin input[type="radio"] {
  flex: 0 0 var(--admin-checkbox-size);
  inline-size: var(--admin-checkbox-size);
  block-size: var(--admin-checkbox-size);
  width: var(--admin-checkbox-size);
  height: var(--admin-checkbox-size);
  min-width: var(--admin-checkbox-size);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  accent-color: var(--admin-teal);
}

.page-admin label.switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: auto;
  min-height: 28px;
  margin: 0;
  padding: 2px 0;
  line-height: 18px;
}

.page-admin .admin-top-actions,
.page-admin .section-head-side,
.page-admin .task-inline-actions,
.page-admin .admin-create-actions,
.page-admin .admin-user-password-current-actions,
.page-admin .admin-approval-actions,
.page-admin .modal-footer,
.page-admin .row {
  gap: var(--admin-action-gap);
}

.page-admin .admin-top-actions > a,
.page-admin .admin-top-actions > button {
  min-width: 92px;
}

.page-admin .section-head-side > button,
.page-admin .task-inline-actions > button,
.page-admin .admin-create-actions > button,
.page-admin .admin-user-password-current-actions > button,
.page-admin .admin-user-password-result > button,
.page-admin .modal-footer > button,
.page-admin .row > button,
.page-admin .row > .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
}

.page-admin .admin-sidebar-actions > a,
.page-admin .admin-sidebar-actions > button,
.page-admin .admin-nav button {
  min-height: 40px;
  padding: 8px 12px;
}

.page-admin .secret-toggle,
.page-admin .admin-model-add-btn {
  inline-size: var(--admin-control-height);
  block-size: var(--admin-control-height);
  width: var(--admin-control-height);
  height: var(--admin-control-height);
  min-width: var(--admin-control-height);
  min-height: var(--admin-control-height);
  padding: 0;
}

.page-admin .admin-model-list-input-row,
.page-admin .admin-model-list-input-row-picker {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--admin-action-gap);
}

.page-admin .admin-model-picker-btn {
  width: auto;
  min-width: 88px;
}

.page-admin .admin-model-chip-remove,
.page-admin .admin-model-chip-order {
  inline-size: var(--admin-compact-height);
  block-size: var(--admin-compact-height);
  width: var(--admin-compact-height);
  height: var(--admin-compact-height);
  min-width: var(--admin-compact-height);
  min-height: var(--admin-compact-height);
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.page-admin .admin-user-table td:last-child button,
.page-admin .admin-task-actions button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.page-admin .admin-user-pagination-actions button {
  min-width: 78px;
}

.page-admin .modal-overlay[aria-hidden="false"] {
  overscroll-behavior: contain;
}

body.page-admin:has(.modal-overlay[aria-hidden="false"]) {
  overflow: hidden;
}

.page-admin .modal-card {
  max-height: calc(100dvh - 32px);
}

.page-admin .modal-body {
  overscroll-behavior: contain;
}

@media (max-width: 720px) {
  .page-admin .admin-top-actions > a,
  .page-admin .admin-top-actions > button,
  .page-admin .section-head-side > button,
  .page-admin .task-inline-actions > button,
  .page-admin .row > button,
  .page-admin .row > .btn,
  .page-admin .admin-user-password-current-actions > button,
  .page-admin .admin-user-password-result > button,
  .page-admin .modal-footer > button {
    flex: 1 1 calc(50% - 4px);
    width: auto;
    min-width: 108px;
    white-space: normal;
  }

  .page-admin .admin-user-password-current-actions,
  .page-admin .admin-user-password-result,
  .page-admin .modal-footer {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Final account-page overrides must follow the shared admin control rules. */
.page-admin #secUsers .admin-account-tab {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
}

.page-admin #secUsers .admin-user-table th:last-child,
.page-admin #secUsers .admin-user-table td:last-child {
  width: 164px;
  min-width: 164px;
}

.page-admin #secUsers .admin-user-table td.admin-user-actions {
  display: flex;
  grid-template-columns: none;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .page-admin #secUsers .admin-account-tab {
    min-width: 0;
  }

  .page-admin #secUsers .admin-user-table th:last-child,
  .page-admin #secUsers .admin-user-table td:last-child {
    width: 112px;
    min-width: 112px;
  }

  .page-admin #secUsers .admin-user-table td.admin-user-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    justify-content: stretch;
  }
}

/* Admin commercial billing workspace. */
.page-admin #secPricing .admin-billing-stack {
  display: grid;
  gap: 12px;
}

.page-admin #secPricing .admin-billing-panel {
  min-width: 0;
  border-radius: 8px;
}

.page-admin #secPricing .admin-billing-panel-head,
.page-admin #secPricing .admin-billing-toolbar,
.page-admin #secPricing .admin-billing-form-actions,
.page-admin #secPricing .admin-billing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-admin #secPricing .admin-billing-panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-admin #secPricing .admin-billing-panel-head .admin-config-card-title {
  margin-bottom: 3px;
}

.page-admin #secPricing .admin-billing-panel-head .small {
  line-height: 1.5;
}

.page-admin #secPricing .admin-billing-pending,
.page-admin #secPricing .admin-billing-status,
.page-admin #secRedemptionCodes .admin-billing-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #efd493;
  border-radius: 999px;
  color: #8a5a08;
  background: #fff6dc;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-status.is-active,
.page-admin #secPricing .admin-billing-status.is-approved,
.page-admin #secPricing .admin-billing-status.is-enforced,
.page-admin #secPricing .admin-billing-status.is-redeemed {
  color: #176b4d;
  background: #e8f7ef;
  border-color: #b8e1ca;
}

.page-admin #secPricing .admin-billing-status.is-draft,
.page-admin #secPricing .admin-billing-status.is-pending,
.page-admin #secRedemptionCodes .admin-billing-status.is-draft,
.page-admin #secRedemptionCodes .admin-billing-status.is-pending {
  color: #8a5a08;
  background: #fff6dc;
  border-color: #efd493;
}

.page-admin #secPricing .admin-billing-status.is-rejected,
.page-admin #secPricing .admin-billing-status.is-cancelled,
.page-admin #secPricing .admin-billing-status.is-revoked,
.page-admin #secRedemptionCodes .admin-billing-status.is-rejected,
.page-admin #secRedemptionCodes .admin-billing-status.is-cancelled,
.page-admin #secRedemptionCodes .admin-billing-status.is-revoked {
  color: #a23737;
  background: #fff0f0;
  border-color: #efc2c2;
}

.page-admin #secRedemptionCodes .admin-billing-status.is-redeemed {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.page-admin #secRedemptionCodes .admin-billing-status.is-active {
  color: #8a5a08;
  background: #fff6dc;
  border-color: #efd493;
}

.page-admin #secPricing .admin-billing-status.is-retired,
.page-admin #secPricing .admin-billing-status.is-legacy,
.page-admin #secPricing .admin-billing-status.is-unknown,
.page-admin #secRedemptionCodes .admin-billing-status.is-retired,
.page-admin #secRedemptionCodes .admin-billing-status.is-legacy,
.page-admin #secRedemptionCodes .admin-billing-status.is-unknown {
  color: #59636d;
  background: #f1f3f5;
  border-color: #d7dde2;
}

.page-admin #secRedemptionCodes .admin-billing-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #efd493;
  border-radius: 999px;
  color: #8a5a08;
  background: #fff6dc;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
}

.page-admin #secRedemptionCodes .admin-billing-status.is-active {
  color: #8a5a08;
  background: #fff6dc;
  border-color: #efd493;
}

.page-admin #secRedemptionCodes .admin-billing-status.is-redeemed {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.page-admin #secRedemptionCodes .admin-billing-status.is-revoked {
  color: #a23737;
  background: #fff0f0;
  border-color: #efc2c2;
}

.page-admin #secRedemptionCodes .admin-redemption-form {
  display: grid;
  grid-template-columns: minmax(160px, .6fr) minmax(130px, .4fr) minmax(260px, 1fr) auto;
  column-gap: 14px;
  row-gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-presets {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 9px;
  background: #f8fbfd;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-groups {
  display: grid;
  gap: 9px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-group {
  display: grid;
  gap: 6px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  text-align: center;
  color: var(--admin-ink);
  background: #fff;
  border: 1px solid #b8cbd8;
  border-radius: 8px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset:hover,
.page-admin #secRedemptionCodes .admin-redemption-preset:focus-visible {
  color: #fff;
  background: #1c658f;
  border-color: #1c658f;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head,
.page-admin #secRedemptionCodes .admin-billing-toolbar,
.page-admin #secRedemptionCodes .admin-billing-actions,
.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head {
  min-width: 0;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head > div:first-child {
  min-width: 180px;
}

.page-admin #secRedemptionCodes .admin-billing-toolbar {
  align-items: flex-end;
  column-gap: 14px;
  row-gap: 10px;
  flex: 1 1 820px;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.page-admin #secRedemptionCodes .admin-billing-toolbar select {
  width: auto;
  min-width: 180px;
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size,
.page-admin #secRedemptionCodes .admin-redemption-code-check {
  margin: 0;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  width: auto;
  color: var(--admin-muted);
  white-space: nowrap;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size select {
  width: 82px;
  min-width: 82px;
}

.page-admin #secRedemptionCodes .admin-redemption-code-check {
  display: flex;
  flex: 1 1 320px;
  min-width: 220px;
}

.page-admin #secRedemptionCodes .admin-redemption-code-check input {
  width: 100%;
  min-width: 0;
}

.page-admin #secRedemptionCodes .admin-compact-button,
.page-admin #secRedemptionCodes .admin-redemption-form input,
.page-admin #secRedemptionCodes .admin-redemption-form select {
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-form label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--admin-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.page-admin #secRedemptionCodes .admin-redemption-form input {
  width: 100%;
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-form select {
  width: 100%;
}

.page-admin #secRedemptionCodes .admin-redemption-created {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #b8e1ca;
  border-radius: 7px;
  background: #f2faf7;
}

.page-admin #secRedemptionCodes .admin-redemption-created pre {
  overflow: auto;
  max-height: 220px;
  margin: 0;
  padding: 10px;
  color: #e9fff5;
  background: #173247;
  border-radius: 6px;
  font: 700 13px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  user-select: all;
}

.page-admin #secRedemptionCodes .admin-redemption-table {
  min-width: 1120px;
  table-layout: fixed;
}

.page-admin #secRedemptionCodes .admin-invitation-table {
  min-width: 1120px;
  table-layout: fixed;
}

.page-admin #secRedemptionCodes .admin-invitation-table th,
.page-admin #secRedemptionCodes .admin-invitation-table td {
  padding: 7px 9px;
  vertical-align: middle;
  font-size: 12px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(1),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(1) { width: 170px; }
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(2),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(2),
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(3),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(3) { width: 140px; }
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(4),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(4) { width: 220px; }
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(5),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(5) { width: 126px; }
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(6),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(6),
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(7),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(7) { width: 150px; }
.page-admin #secRedemptionCodes .admin-invitation-table th:nth-child(8),
.page-admin #secRedemptionCodes .admin-invitation-table td:nth-child(8) { width: 160px; }

.page-admin #secRedemptionCodes .admin-invitation-table td:first-child {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.page-admin #secRedemptionCodes .admin-redemption-table th,
.page-admin #secRedemptionCodes .admin-redemption-table td {
  padding: 5px 7px;
  vertical-align: middle;
  font-size: 12px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(1),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(1) {
  width: 30px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(2),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(2) {
  width: 180px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(3),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(3) {
  width: 290px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(4),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(4) {
  width: 90px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(5),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(5) {
  width: 90px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(6),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(6),
.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(7),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(7) {
  width: 150px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(8),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(8) {
  width: 118px;
}

.page-admin #secRedemptionCodes .admin-redemption-detail {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secRedemptionCodes .admin-redemption-table .admin-billing-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 4px;
}

.page-admin #secRedemptionCodes .admin-redemption-icon-button {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 5px;
  place-items: center;
}

.page-admin #secRedemptionCodes .admin-redemption-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: -2px 0 10px;
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result.is-available {
  color: #176b4d;
  background: #e8f7ef;
  border-color: #b8e1ca;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result.is-error {
  color: #a23737;
  background: #fff0f0;
  border-color: #efc2c2;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 28px;
  margin: 0 0 6px;
  padding: 3px 6px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #f8fbfd;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar strong {
  margin-right: auto;
  color: var(--admin-ink-soft);
  font-size: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar .admin-compact-button {
  min-height: 26px;
  padding: 2px 7px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-select-cell {
  width: 30px;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.page-admin #secRedemptionCodes .admin-redemption-row-select {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
}

.page-admin #secRedemptionCodes .admin-redemption-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-top: 10px;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-pagination > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-admin #secRedemptionCodes #redemptionCodeHealth.is-error {
  color: #a23737;
  background: #fff0f0;
  border-left-color: #d55a5a;
}

@media (max-width: 980px) {
  .page-admin #secRedemptionCodes .admin-billing-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin #secRedemptionCodes .admin-billing-toolbar {
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-admin #secRedemptionCodes .admin-redemption-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin #secRedemptionCodes .admin-redemption-note {
    grid-column: 1 / -1;
  }
}
.page-admin #secPricing .admin-billing-active-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-left: 3px solid var(--admin-teal);
  background: #f2faf7;
  color: var(--admin-ink-soft);
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-active-summary strong {
  color: var(--admin-ink);
  font-size: 13px;
}

.page-admin #secPricing .admin-billing-catalog-layout,
.page-admin #secPricing .admin-billing-user-layout {
  display: grid;
  gap: 12px;
  align-items: start;
}

.page-admin #secPricing .admin-billing-catalog-layout {
  grid-template-columns: minmax(0, 1fr);
}

.page-admin #secPricing .admin-billing-user-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .7fr);
}

.page-admin #secPricing .admin-billing-table-wrap {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-table {
  width: 100%;
  min-width: 660px;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap .admin-billing-table {
  min-width: 0;
  table-layout: fixed;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap th:first-child {
  width: 22%;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap th:nth-child(2) {
  width: 14%;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap th:nth-child(3),
.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap th:nth-child(4) {
  width: 21%;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap th:last-child {
  width: 22%;
}

.page-admin #secPricing .admin-billing-catalog-layout > .admin-billing-table-wrap td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-admin #secPricing .admin-billing-order-table {
  min-width: 960px;
}

.page-admin #secPricing .admin-billing-table th,
.page-admin #secPricing .admin-billing-table td {
  padding: 8px 9px;
  vertical-align: middle;
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-table td > strong,
.page-admin #secPricing .admin-billing-table td > span:not(.admin-billing-status) {
  display: block;
}

.page-admin #secPricing .admin-billing-table td > span:not(.admin-billing-status) {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-strong,
.page-admin #secPricing .admin-billing-money {
  color: var(--admin-ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.page-admin #secPricing .admin-billing-reference {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-actions {
  min-width: 122px;
  flex-wrap: wrap;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #secPricing .admin-compact-button,
.page-admin #secPricing .admin-billing-actions button {
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
  line-height: 20px;
}

.page-admin #secPricing .admin-billing-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-admin #secPricing .admin-billing-toolbar input,
.page-admin #secPricing .admin-billing-toolbar select {
  width: auto;
  min-width: 128px;
  min-height: 32px;
  padding: 4px 9px;
  font-size: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-form {
  display: grid;
  grid-template-columns: minmax(160px, .6fr) minmax(130px, .4fr) minmax(260px, 1fr) auto;
  column-gap: 14px;
  row-gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-presets {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 9px;
  background: #f8fbfd;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-groups {
  display: grid;
  gap: 9px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-group {
  display: grid;
  gap: 6px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  text-align: center;
  color: var(--admin-ink);
  background: #fff;
  border: 1px solid #b8cbd8;
  border-radius: 8px;
}

.page-admin #secRedemptionCodes .admin-redemption-preset:hover,
.page-admin #secRedemptionCodes .admin-redemption-preset:focus-visible {
  color: #fff;
  background: #1c658f;
  border-color: #1c658f;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head,
.page-admin #secRedemptionCodes .admin-billing-toolbar,
.page-admin #secRedemptionCodes .admin-billing-actions,
.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head {
  min-width: 0;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.page-admin #secRedemptionCodes .admin-billing-panel-head > div:first-child {
  min-width: 180px;
}

.page-admin #secRedemptionCodes .admin-billing-toolbar {
  align-items: flex-end;
  column-gap: 14px;
  row-gap: 10px;
  flex: 1 1 820px;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.page-admin #secRedemptionCodes .admin-billing-toolbar select {
  width: auto;
  min-width: 180px;
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size,
.page-admin #secRedemptionCodes .admin-redemption-code-check {
  margin: 0;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  width: auto;
  color: var(--admin-muted);
  white-space: nowrap;
}

.page-admin #secRedemptionCodes .admin-redemption-page-size select {
  width: 82px;
  min-width: 82px;
}

.page-admin #secRedemptionCodes .admin-redemption-code-check {
  display: flex;
  flex: 1 1 320px;
  min-width: 220px;
}

.page-admin #secRedemptionCodes .admin-redemption-code-check input {
  width: 100%;
  min-width: 0;
}

.page-admin #secRedemptionCodes .admin-compact-button,
.page-admin #secRedemptionCodes .admin-redemption-form input {
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-form label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--admin-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.page-admin #secRedemptionCodes .admin-redemption-form input {
  width: 100%;
  min-height: 38px;
}

.page-admin #secRedemptionCodes .admin-redemption-created {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #b8e1ca;
  border-radius: 7px;
  background: #f2faf7;
}

.page-admin #secRedemptionCodes .admin-redemption-created pre {
  overflow: auto;
  max-height: 220px;
  margin: 0;
  padding: 10px;
  color: #e9fff5;
  background: #173247;
  border-radius: 6px;
  font: 700 13px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace;
  user-select: all;
}

.page-admin #secRedemptionCodes .admin-redemption-table {
  min-width: 1120px;
  table-layout: fixed;
}

.page-admin #secRedemptionCodes .admin-redemption-table th,
.page-admin #secRedemptionCodes .admin-redemption-table td {
  padding: 5px 7px;
  vertical-align: middle;
  font-size: 12px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(1),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(1) {
  width: 30px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(2),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(2) {
  width: 180px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(3),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(3) {
  width: 290px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(4),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(4) {
  width: 90px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(5),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(5) {
  width: 90px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(6),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(6),
.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(7),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(7) {
  width: 150px;
}

.page-admin #secRedemptionCodes .admin-redemption-table th:nth-child(8),
.page-admin #secRedemptionCodes .admin-redemption-table td:nth-child(8) {
  width: 118px;
}

.page-admin #secRedemptionCodes .admin-redemption-detail {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secRedemptionCodes .admin-redemption-table .admin-billing-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 4px;
}

.page-admin #secRedemptionCodes .admin-redemption-icon-button {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 5px;
  place-items: center;
}

.page-admin #secRedemptionCodes .admin-redemption-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: -2px 0 10px;
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result.is-available {
  color: #176b4d;
  background: #e8f7ef;
  border-color: #b8e1ca;
}

.page-admin #secRedemptionCodes .admin-redemption-check-result.is-error {
  color: #a23737;
  background: #fff0f0;
  border-color: #efc2c2;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  min-height: 28px;
  margin: 0 0 6px;
  padding: 3px 6px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #f8fbfd;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar strong {
  margin-right: auto;
  color: var(--admin-ink-soft);
  font-size: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-bulk-toolbar .admin-compact-button {
  min-height: 26px;
  padding: 2px 7px;
  line-height: 18px;
}

.page-admin #secRedemptionCodes .admin-redemption-select-cell {
  width: 30px;
  padding-right: 3px;
  padding-left: 3px;
  text-align: center;
}

.page-admin #secRedemptionCodes .admin-redemption-row-select {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
}

.page-admin #secRedemptionCodes .admin-redemption-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin-top: 10px;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin #secRedemptionCodes .admin-redemption-pagination > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-admin #secRedemptionCodes #redemptionCodeHealth.is-error {
  color: #a23737;
  background: #fff0f0;
  border-left-color: #d55a5a;
}

@media (max-width: 980px) {
  .page-admin #secRedemptionCodes .admin-billing-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin #secRedemptionCodes .admin-billing-toolbar {
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-admin #secRedemptionCodes .admin-redemption-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin #secRedemptionCodes .admin-redemption-note {
    grid-column: 1 / -1;
  }
}

.page-admin #secPricing .admin-billing-editor,
.page-admin #secPricing .admin-billing-adjustment {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #f8fbfa;
}

.page-admin #secPricing .admin-billing-editor {
  gap: 10px;
  padding: 12px;
  background: #f7f9fa;
}

.page-admin #secPricing .admin-billing-editor label,
.page-admin #secPricing .admin-billing-adjustment label {
  margin: 0;
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-editor-head,
.page-admin #secPricing .admin-billing-editor-section-head,
.page-admin #secPricing .admin-billing-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.page-admin #secPricing .admin-billing-editor-head > div,
.page-admin #secPricing .admin-billing-editor-section-head > div {
  min-width: 0;
}

.page-admin #secPricing .admin-billing-editor-head strong,
.page-admin #secPricing .admin-billing-editor-head span,
.page-admin #secPricing .admin-billing-editor-section-head strong,
.page-admin #secPricing .admin-billing-editor-section-head span {
  display: block;
}

.page-admin #secPricing .admin-billing-editor-head strong {
  color: var(--admin-ink);
  font-size: 14px;
}

.page-admin #secPricing .admin-billing-editor-head > div > span,
.page-admin #secPricing .admin-billing-editor-section-head span,
.page-admin #secPricing .admin-billing-item-title span {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-editor-step {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #cbd5dc;
  border-radius: 999px;
  background: #ffffff;
  color: var(--admin-ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-catalog-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.page-admin #secPricing .admin-billing-catalog-facts > div {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-catalog-facts span,
.page-admin #secPricing .admin-billing-catalog-facts strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-catalog-facts span {
  color: var(--admin-muted);
  font-size: 10px;
}

.page-admin #secPricing .admin-billing-catalog-facts strong {
  margin-top: 2px;
  color: var(--admin-ink);
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-editor-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #edf1f3;
}

.page-admin #secPricing .admin-billing-editor-tabs button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--admin-ink-soft);
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.page-admin #secPricing .admin-billing-editor-tabs button:hover {
  background: rgba(255, 255, 255, .72);
}

.page-admin #secPricing .admin-billing-editor-tabs button.is-active {
  color: #ffffff;
  background: #233b4a;
}

.page-admin #secPricing .admin-billing-editor-tabs button:focus-visible {
  outline: 2px solid var(--admin-success-accent);
  outline-offset: 1px;
}

.page-admin #secPricing .admin-billing-editor-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--admin-line);
}

.page-admin #secPricing .admin-billing-editor-section[data-billing-editor-panel] {
  padding-top: 2px;
  border-top: 0;
}

.page-admin #secPricing .admin-billing-editor-section-head strong {
  color: var(--admin-ink);
  font-size: 13px;
}

.page-admin #secPricing .admin-billing-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.page-admin #secPricing .admin-billing-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--admin-ink-soft);
  font-weight: 700;
}

.page-admin #secPricing .admin-billing-field-wide {
  grid-column: 1 / -1;
}

.page-admin #secPricing .admin-billing-field input,
.page-admin #secPricing .admin-billing-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 6px 8px;
  border-color: var(--admin-line);
  background: #ffffff;
  color: var(--admin-ink);
  font: inherit;
  font-weight: 500;
}

.page-admin #secPricing .admin-billing-field textarea,
.page-admin #secPricing #billingSubscriptionFeatures {
  min-height: 74px;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.page-admin #secPricing .admin-billing-dynamic-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.page-admin #secPricing #billingSubscriptionEditorList {
  grid-template-columns: minmax(0, 1fr);
}

.page-admin #secPricing .admin-billing-subscription-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #f8fafb;
}

.page-admin #secPricing .admin-billing-subscription-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 1px;
  color: var(--admin-ink-soft);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-subscription-group-head > div,
.page-admin #secPricing .admin-billing-subscription-group-head strong,
.page-admin #secPricing .admin-billing-subscription-group-head span {
  display: block;
}

.page-admin #secPricing .admin-billing-subscription-group-head strong {
  margin-bottom: 2px;
  color: var(--admin-ink);
  font-size: 13px;
}

.page-admin #secPricing .admin-billing-subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 8px;
  min-width: 0;
}

.page-admin #secPricing .admin-billing-rule-section {
  margin-top: 2px;
}

.page-admin #secPricing .admin-billing-rule-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 6px;
}

.page-admin #secPricing .admin-billing-rule-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-rule-card strong {
  color: var(--admin-ink);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-rule-card span {
  color: var(--admin-muted);
  font-size: 10px;
  line-height: 1.45;
}

.page-admin #secPricing #billingPackageEditorList {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.page-admin #secPricing #billingActionEditorList {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
}

.page-admin #secPricing #billingAutomationEditorList {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.page-admin #secPricing .admin-billing-package-card,
.page-admin #secPricing .admin-billing-action-card,
.page-admin #secPricing .admin-billing-automation-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-automation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-admin #secPricing .admin-billing-automation-copy {
  min-width: 0;
}

.page-admin #secPricing .admin-billing-automation-copy strong,
.page-admin #secPricing .admin-billing-automation-copy span {
  display: block;
}

.page-admin #secPricing .admin-billing-automation-copy strong {
  color: var(--admin-ink);
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-automation-copy span {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-automation-charge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #aab9c2;
  border-radius: 999px;
  color: #233b4a;
  background: #f4f7f9;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-automation-charge.is-free {
  border-color: #c6d0d6;
  color: var(--admin-ink-soft);
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-automation-charge.is-warning {
  border-color: #e0b5ae;
  color: #9a4035;
  background: #fff7f5;
}

.page-admin #secPricing .admin-billing-package-card {
  display: grid;
  gap: 8px;
}

.page-admin #secPricing .admin-billing-item-title strong {
  color: var(--admin-ink);
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-item-title span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-item-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-admin #secPricing .admin-billing-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.page-admin #secPricing .admin-billing-action-card .admin-billing-field-wide {
  grid-column: 1 / -1;
}

.page-admin #secPricing .admin-billing-action-card .admin-billing-action-toggle {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.page-admin #secPricing .admin-billing-action-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #f5f7f8;
  color: var(--admin-ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-action-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.page-admin #secPricing .admin-billing-dynamic-list.is-empty {
  display: block;
  padding: 12px;
  border: 1px dashed var(--admin-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--admin-muted);
  font-size: 12px;
  text-align: center;
}

.page-admin #secPricing .admin-billing-form-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 4px;
}

.page-admin #secPricing .admin-billing-empty,
.page-admin #secPricing .admin-billing-empty-panel {
  color: var(--admin-muted);
  text-align: center;
}

.page-admin #secPricing .admin-billing-empty {
  height: 72px;
}

.page-admin #secPricing .admin-billing-empty-panel {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--admin-line);
  border-radius: 7px;
  background: #fbfcfd;
  font-size: 12px;
}

.page-admin #secPricing .admin-billing-empty-panel[hidden],
.page-admin #secPricing #billingUserWorkspace[hidden] {
  display: none;
}

.page-admin #secPricing .admin-billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.page-admin #secPricing .admin-billing-summary-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
}

.page-admin #secPricing .admin-billing-summary-item span,
.page-admin #secPricing .admin-billing-summary-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin #secPricing .admin-billing-summary-item span {
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin #secPricing .admin-billing-summary-item strong {
  margin-top: 4px;
  color: var(--admin-ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.page-admin #secPricing .admin-billing-summary-item.is-positive strong,
.page-admin #secPricing .admin-billing-positive {
  color: #176b4d;
}

.page-admin #secPricing .admin-billing-negative {
  color: #a23737;
}

.page-admin #secPricing .admin-billing-adjustment textarea {
  min-height: 88px;
  resize: vertical;
}

.page-admin .admin-billing-unlimited-option {
  width: fit-content;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--admin-ink);
  font-weight: 750;
}

.page-admin .admin-billing-unlimited-option:has(input:checked) {
  border-color: #54b99c;
  background: #e9f8f2;
  color: #176b4d;
}

.page-admin .admin-billing-unlimited-option:has(input:disabled) {
  opacity: .55;
}

.page-admin #rechargeModal .admin-billing-unlimited-option {
  margin-bottom: 4px;
}

.page-admin #secPricing .admin-billing-adjustment button {
  justify-self: start;
}

.page-admin #secPricing .admin-billing-legacy summary {
  display: flex;
  cursor: pointer;
  color: var(--admin-ink);
  font-size: 13px;
}

.page-admin #secPricing .admin-billing-legacy summary span,
.page-admin #secPricing .admin-billing-legacy summary small {
  display: block;
}

.page-admin #secPricing .admin-billing-legacy summary small {
  margin-top: 3px;
  color: var(--admin-muted);
  font-weight: 400;
}

.page-admin #secPricing .admin-billing-pricing-grid {
  margin-top: 14px;
}

.page-admin #secPricing .admin-billing-pricing-actions {
  margin-top: 12px;
}

.page-admin #secUsers .admin-user-table th:last-child,
.page-admin #secUsers .admin-user-table td:last-child {
  width: 230px;
  min-width: 230px;
}

.page-admin #secUsers .admin-user-table td:last-child .admin-user-icon-button {
  width: auto;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
}

@media (max-width: 720px) {
  .page-admin #secUsers .admin-user-table th:last-child,
  .page-admin #secUsers .admin-user-table td:last-child {
    width: 112px;
    min-width: 112px;
  }

  .page-admin #secUsers .admin-user-table td:last-child .admin-user-icon-button {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .page-admin #secPricing .admin-billing-catalog-layout,
  .page-admin #secPricing .admin-billing-user-layout {
    grid-template-columns: 1fr;
  }

  .page-admin #secPricing .admin-billing-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-admin #secPricing .admin-billing-subscription-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin #secPricing .admin-billing-catalog-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-admin #secPricing .admin-billing-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin #secPricing .admin-billing-toolbar {
    justify-content: flex-start;
  }

  .page-admin .admin-billing-unlimited-option {
    width: 100%;
    min-height: 44px;
  }

  .page-admin #secPricing .admin-billing-toolbar input,
  .page-admin #secPricing .admin-billing-toolbar select {
    flex: 1 1 128px;
    width: auto;
  }

  .page-admin #secPricing .admin-billing-summary-grid,
  .page-admin #secPricing .admin-billing-pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-admin #secPricing #billingPackageEditorList,
  .page-admin #secPricing #billingSubscriptionEditorList,
  .page-admin #secPricing .admin-billing-subscription-grid,
  .page-admin #secPricing .admin-billing-rule-list,
  .page-admin #secPricing #billingActionEditorList,
  .page-admin #secPricing .admin-billing-field-grid,
  .page-admin #secPricing .admin-billing-action-card {
    grid-template-columns: 1fr;
  }

  .page-admin #secPricing .admin-billing-catalog-facts,
  .page-admin #secPricing .admin-billing-editor-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin #secPricing .admin-billing-automation-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-admin #secPricing .admin-billing-action-card .admin-billing-field-wide {
    grid-column: auto;
  }

  .page-admin #secPricing .admin-billing-action-card .admin-billing-action-toggle {
    grid-column: auto;
  }

  .page-admin #secPricing .admin-billing-summary-item strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .page-admin #secUsers .admin-user-table th:last-child,
  .page-admin #secUsers .admin-user-table td:last-child {
    width: 132px;
    min-width: 132px;
  }
}

/* Final shared mobile overrides for auth, admin, and persona dashboard pages. */
@media (max-width: 760px) {
  .page-auth-shell,
  .page-auth-shell .auth-shell {
    min-height: 100dvh;
  }

  .page-auth-shell .auth-shell {
    width: 100%;
    min-width: 0;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .page-auth-shell .auth-card-product {
    order: -1;
  }

  .page-auth-shell .auth-stage,
  .page-auth-shell .auth-card-product,
  .page-auth-shell .auth-stage-card,
  .page-auth-shell .auth-form {
    min-width: 0;
    max-width: 100%;
  }

  .page-auth-shell input,
  .page-auth-shell select,
  .page-auth-shell button,
  .page-auth-shell .btn {
    min-height: 44px;
  }

  .page-auth-shell .auth-login-password-toggle {
    width: 44px;
    height: 44px;
    min-height: 44px;
    right: 2px;
  }

  .page-auth-shell .auth-login-password-field input {
    padding-right: 52px;
  }

  body.page-admin {
    min-height: 100dvh;
    overflow-x: hidden;
  }

  .page-admin .layout.admin-layout,
  .page-admin .main,
  .page-admin .admin-page-view,
  .page-admin .section,
  .page-admin .card,
  .page-admin .admin-table-shell,
  .page-admin .table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .page-admin .sidebar {
    padding-top: max(9px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .page-admin .main {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .page-admin button,
  .page-admin .btn,
  .page-admin .admin-nav button,
  .page-admin .admin-sidebar-actions > a,
  .page-admin .admin-sidebar-actions > button,
  .page-admin .admin-user-table td:last-child button,
  .page-admin .admin-task-actions button,
  .page-admin .secret-toggle,
  .page-admin .admin-model-add-btn,
  .page-admin .admin-model-chip-remove,
  .page-admin .admin-model-chip-order {
    min-height: 44px;
  }

  .page-admin .table-wrap,
  .page-admin .admin-table-shell {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .page-admin .table {
    min-width: 680px;
  }

  .page-admin .admin-user-table {
    min-width: 640px;
  }

  .persona-dashboard-view,
  .persona-dashboard-app,
  .persona-dashboard-page,
  .persona-person-layout,
  .persona-workbench-panel,
  .persona-overview-pane {
    min-width: 0;
    max-width: 100%;
  }

  .persona-dashboard-hero,
  .persona-chart-head,
  .persona-list-head {
    gap: 12px;
  }

  .persona-dashboard-actions {
    min-width: 0;
    width: 100%;
  }

  .persona-dashboard-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .persona-dashboard-action-buttons > button,
  .persona-dashboard-view input,
  .persona-dashboard-view select {
    min-height: 44px;
  }

}

@media (max-width: 480px) {
  .page-auth-shell .auth-stage,
  .page-auth-shell .auth-card-product {
    padding: 16px;
    border-radius: 14px;
  }

  .page-auth-shell .auth-stage-title {
    font-size: 28px;
    overflow-wrap: anywhere;
  }

  .page-admin .sidebar {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-sidebar-actions {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .page-admin .admin-sidebar-actions > a,
  .page-admin .admin-sidebar-actions > button {
    width: 100%;
    padding-inline: 8px;
    white-space: normal;
  }

  .page-admin .admin-nav {
    grid-column: 1;
    grid-row: 3;
  }

  .page-admin .main {
    width: calc(100% - 12px);
  }

  .page-admin .admin-page-title h2,
  .persona-dashboard-hero h2 {
    font-size: 26px;
  }

  .persona-dashboard-hero,
.persona-workbench-panel,
.persona-chart-panel {
    padding: 12px;
  }

  .persona-dashboard-action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .persona-dashboard-action-buttons > button {
    width: 100%;
  }
}

/* Compact admin mobile header with an off-canvas page picker. */
.page-admin .admin-mobile-nav-toggle,
.page-admin .admin-mobile-drawer-head,
.page-admin .admin-mobile-nav-backdrop {
  display: none;
}

.page-admin .admin-mobile-drawer {
  display: contents;
}

@media (max-width: 760px) {
  body.page-admin.admin-mobile-nav-open {
    overflow: hidden;
  }

  .page-admin .sidebar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: block;
    padding:
      max(7px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      7px
      max(10px, env(safe-area-inset-left));
  }

  body.page-admin.admin-mobile-nav-open .sidebar {
    z-index: 1002;
  }

  .page-admin .brand {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .page-admin .admin-brand-lockup {
    min-width: 0;
    gap: 8px;
  }

  .page-admin .admin-brand-mark {
    width: 30px;
    height: 30px;
  }

  .page-admin .admin-brand-eyebrow {
    font-size: 9px;
  }

  .page-admin .brand h1 {
    margin-top: 1px;
    font-size: 15px;
    line-height: 1.1;
  }

  .page-admin .admin-mobile-nav-toggle {
    display: inline-flex;
    width: auto;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    color: #effff9;
    border: 1px solid rgba(117, 241, 211, 0.28);
    border-radius: 7px;
    background: rgba(12, 154, 154, 0.16);
    box-shadow: none;
    font-size: 12px;
    white-space: nowrap;
  }

  .page-admin .admin-mobile-nav-icon {
    display: grid;
    width: 14px;
    gap: 3px;
  }

  .page-admin .admin-mobile-nav-icon i {
    display: block;
    width: 100%;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
  }

  .page-admin .admin-mobile-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1002;
    display: flex;
    width: min(84vw, 310px);
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
    padding:
      max(14px, env(safe-area-inset-top))
      12px
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    color: #effff9;
    border-right: 1px solid rgba(117, 241, 211, 0.2);
    background: rgba(5, 18, 17, 0.985);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.36);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .page-admin.admin-mobile-nav-open .admin-mobile-drawer,
  body.page-admin.admin-mobile-nav-open .admin-mobile-drawer {
    transform: translateX(0);
  }

  .page-admin .admin-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px 10px;
    border-bottom: 1px solid rgba(218, 255, 243, 0.14);
  }

  .page-admin .admin-mobile-drawer-head > div {
    display: grid;
    gap: 2px;
  }

  .page-admin .admin-mobile-drawer-head span {
    color: rgba(237, 255, 249, 0.6);
    font-size: 10px;
    letter-spacing: .08em;
  }

  .page-admin .admin-mobile-drawer-head strong {
    font-size: 16px;
  }

  .page-admin #adminMobileNavClose {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    color: #effff9;
    border: 1px solid rgba(218, 255, 243, 0.16);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    font-size: 22px;
    line-height: 1;
  }

  .page-admin .admin-nav {
    position: static;
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    overflow: visible;
  }

  .page-admin .admin-nav button,
  .page-admin .admin-nav button.is-active {
    width: 100%;
    min-height: 39px;
    padding: 8px 10px;
    justify-content: space-between;
    color: rgba(237, 255, 249, 0.78);
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    font-size: 13px;
    text-align: left;
  }

  .page-admin .admin-nav button.is-active {
    color: #ffffff;
    border-color: rgba(117, 241, 211, 0.3);
    background: rgba(12, 154, 154, 0.2);
  }

  .page-admin .admin-nav button.is-active::before {
    display: block;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
  }

  .page-admin .admin-sidebar-actions {
    display: grid;
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    border-top: 1px solid rgba(218, 255, 243, 0.13);
  }

  .page-admin .admin-sidebar-actions > a,
  .page-admin .admin-sidebar-actions > button {
    display: inline-flex;
    width: 100%;
    min-height: 34px;
    height: 34px;
    justify-content: center;
    padding: 5px 7px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .page-admin .admin-mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    background: rgba(2, 10, 10, 0.56);
    backdrop-filter: blur(2px);
  }

  .page-admin .admin-mobile-nav-backdrop[hidden] {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-admin .admin-mobile-drawer {
    transition: none;
  }
}

.page-admin .admin-profile-menu {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 80;
}

.page-admin .admin-shared-account-host {
  display: grid;
  place-items: center;
}

.page-admin .admin-public-links {
  display: grid;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  grid-template-columns: 1fr;
  gap: 7px;
  border-top: 1px solid rgba(218, 255, 243, 0.13);
}

.page-admin .admin-public-links > .btn.ghost {
  display: inline-flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  color: #effff9;
  border-color: rgba(218, 255, 243, 0.22);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

.page-admin .admin-public-links > .btn.ghost:hover {
  color: #ffffff;
  border-color: rgba(117, 241, 211, 0.34);
  background: rgba(12, 154, 154, 0.16);
}

@media (max-width: 760px) {
  .page-admin .admin-profile-menu {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    order: 2;
    margin-left: auto;
  }

  .page-admin .admin-mobile-nav-toggle {
    order: 3;
    flex: 0 0 auto;
  }

  .page-admin .admin-public-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .page-admin .admin-public-links > .btn.ghost {
    min-height: 34px;
    padding: 5px 7px;
    font-size: 11px;
  }
}

/* Keep the admin navigation in a fixed vertical rail on desktop. */
@media (min-width: 761px) {
  .page-admin .layout.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
    padding: 0;
    gap: 0;
    background: linear-gradient(90deg, rgba(5, 18, 17, 0.96) 0 220px, transparent 220px);
  }

  .page-admin .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    width: 220px;
    height: 100vh;
    max-height: 100vh;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 10px;
    overflow: hidden;
    border: 0;
    border-right: 1px solid rgba(218, 255, 243, 0.15);
    border-radius: 0;
  }

  .page-admin .brand {
    padding: 0 2px 10px;
    border: 0;
    border-bottom: 1px solid rgba(218, 255, 243, 0.13);
    border-radius: 0;
    background: transparent;
  }

  .page-admin .admin-mobile-drawer {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
  }

  .page-admin .admin-nav {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page-admin .admin-nav button {
    width: 100%;
    flex: 0 0 auto;
    justify-content: space-between;
    text-align: left;
  }

  .page-admin .main {
    min-width: 0;
  }
}

.auth-login-takeover {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  color: #8a2d17;
  background: #fff4ed;
  border: 1px solid #e3a38f;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.auth-login-takeover[hidden] {
  display: none;
}

/* Backend governance surfaces. Scoped to the existing admin console. */
.page-admin {
  --gov-blue: #2474c6;
  --gov-blue-soft: #eaf3fc;
  --gov-success-accent: #356b91;
  --gov-success-soft: #e8f0f7;
  --gov-amber: #a96308;
  --gov-amber-soft: #fff5df;
  --gov-red: #c43e46;
  --gov-red-soft: #fff0f1;
  --gov-neutral-soft: #eef3f2;
}

.page-admin .admin-mfa-banner {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 11px;
  color: #5d3905;
  background: var(--gov-amber-soft);
  border: 1px solid #e7bd72;
  border-left: 4px solid var(--gov-amber);
  border-radius: 7px;
}

.page-admin .admin-mfa-banner[hidden] {
  display: none;
}

.page-admin .admin-mfa-banner-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--gov-amber);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.page-admin .admin-mfa-banner > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.page-admin .admin-mfa-banner span {
  color: #7a541a;
  font-size: 13px;
}

.page-admin .admin-governance-head,
.page-admin .admin-governance-refresh,
.page-admin .admin-governance-panel > header,
.page-admin .admin-user-governance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-admin .admin-governance-refresh {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.page-admin .admin-live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--admin-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.page-admin .admin-live-status i {
  width: 8px;
  height: 8px;
  background: var(--gov-success-accent);
  border-radius: 50%;
}

.page-admin .admin-governance-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(174px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.page-admin .admin-governance-kpi {
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-content: space-between;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-top: 3px solid #879896;
  border-radius: 7px;
  background: #fff;
}

.page-admin .admin-governance-kpi > span,
.page-admin .admin-governance-kpi > small {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-governance-kpi > strong {
  color: var(--admin-ink);
  font-size: 22px;
}

.page-admin .admin-governance-kpi-configurable {
  position: relative;
  padding-right: 46px;
}

.page-admin .admin-kpi-action {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  background: #fff;
  color: var(--admin-ink-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.page-admin .admin-kpi-action:hover {
  border-color: var(--gov-blue);
  color: var(--admin-ink);
}

.page-admin .admin-email-policy-body {
  display: grid;
  gap: 12px;
}

.page-admin .admin-email-policy-preview {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #f7f9fa;
}

.page-admin .admin-email-policy-preview > span,
.page-admin .admin-email-policy-preview > small {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-email-policy-preview > strong {
  color: var(--admin-ink);
  font-size: 15px;
}

.page-admin .admin-governance-kpi.is-info {
  border-top-color: var(--gov-blue);
  background: linear-gradient(180deg, var(--gov-blue-soft), #fff 54%);
}

.page-admin .admin-governance-kpi.is-success,
.page-admin .admin-governance-kpi.is-health {
  border-top-color: var(--gov-success-accent);
  background: linear-gradient(180deg, var(--gov-success-soft), #fff 54%);
}

.page-admin .admin-governance-kpi.is-warning {
  border-top-color: var(--gov-amber);
  background: linear-gradient(180deg, var(--gov-amber-soft), #fff 54%);
}

.page-admin .admin-governance-kpi.is-danger {
  border-top-color: var(--gov-red);
  background: linear-gradient(180deg, var(--gov-red-soft), #fff 54%);
}

.page-admin .admin-governance-kpi.is-danger > strong {
  color: #a92934;
}

.page-admin .admin-governance-kpi.is-success > strong,
.page-admin .admin-governance-kpi.is-health > strong {
  color: #126b3f;
}

.page-admin .admin-governance-chart-grid,
.page-admin .admin-governance-lower-grid,
.page-admin .admin-taxonomy-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.page-admin .admin-governance-chart-grid,
.page-admin .admin-taxonomy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-admin .admin-governance-lower-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-admin .admin-governance-panel {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
}

.page-admin .admin-governance-panel > header {
  min-height: 30px;
  margin-bottom: 8px;
}

.page-admin .admin-governance-panel > header > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.page-admin .admin-governance-panel header strong {
  color: var(--admin-ink);
  font-size: 14px;
}

.page-admin .admin-governance-panel header span {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--admin-muted);
  font-size: 11px;
  white-space: nowrap;
}

.page-admin .admin-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.page-admin .admin-chart-legend .is-blue {
  background: var(--gov-blue);
}

.page-admin .admin-chart-legend .is-success {
  background: var(--gov-success-accent);
}

.page-admin .admin-chart-legend .is-red {
  background: var(--gov-red);
}

.page-admin .admin-governance-chart {
  position: relative;
  display: block;
  width: 100%;
  height: 180px;
  min-height: 180px;
}

.page-admin .admin-governance-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.page-admin .admin-chart-summary {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-distribution-list,
.page-admin .admin-health-list,
.page-admin .admin-taxonomy-list,
.page-admin .admin-session-list,
.page-admin .admin-password-history-list,
.page-admin .admin-security-list {
  display: grid;
  gap: 8px;
}

.page-admin .admin-distribution-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(80px, 1fr) 34px;
  min-height: 28px;
  align-items: center;
  gap: 8px;
  color: var(--admin-ink-soft);
  font-size: 12px;
}

.page-admin .admin-distribution-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f1;
}

.page-admin .admin-distribution-fill {
  height: 100%;
  border-radius: inherit;
  background: #819391;
}

.page-admin .admin-distribution-fill.is-success {
  background: var(--gov-success-accent);
}

.page-admin .admin-distribution-fill.is-warning {
  background: var(--gov-amber);
}

.page-admin .admin-distribution-fill.is-danger {
  background: var(--gov-red);
}

.page-admin .admin-distribution-fill.is-info {
  background: var(--gov-blue);
}

.page-admin .admin-health-row,
.page-admin .admin-taxonomy-item,
.page-admin .admin-session-item,
.page-admin .admin-password-history-item {
  display: grid;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #e2eae8;
  border-radius: 6px;
  background: #fafcfb;
}

.page-admin .admin-health-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.page-admin .admin-health-row strong,
.page-admin .admin-session-item strong,
.page-admin .admin-password-history-item strong {
  overflow-wrap: anywhere;
  color: var(--admin-ink);
  font-size: 12px;
}

.page-admin .admin-health-row span,
.page-admin .admin-session-item span,
.page-admin .admin-password-history-item span {
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-session-item > div,
.page-admin .admin-password-history-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.page-admin .admin-semantic-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 23px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #cbd7d4;
  border-radius: 999px;
  color: #526563;
  background: var(--gov-neutral-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.page-admin .admin-semantic-badge.is-info {
  color: #155791;
  border-color: #a9cbe9;
  background: var(--gov-blue-soft);
}

.page-admin .admin-semantic-badge.is-success {
  color: #11643b;
  border-color: #9fd5b8;
  background: var(--gov-success-soft);
}

.page-admin .admin-semantic-badge.is-warning {
  color: #7b4805;
  border-color: #e9c782;
  background: var(--gov-amber-soft);
}

.page-admin .admin-semantic-badge.is-danger {
  color: #9e2731;
  border-color: #efb2b7;
  background: var(--gov-red-soft);
}

.page-admin .admin-empty-state {
  padding: 22px 12px;
  color: var(--admin-muted);
  border: 1px dashed var(--admin-line);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

.page-admin .admin-governance-filters,
.page-admin .admin-service-account-form,
.page-admin .admin-inline-create-form {
  display: grid;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}

.page-admin .admin-governance-filters {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.page-admin .admin-security-filters {
  grid-template-columns: repeat(2, minmax(160px, 240px));
}

.page-admin .admin-service-account-form {
  grid-template-columns: 1fr 1.4fr 1.4fr minmax(180px, 0.8fr) auto;
}

.page-admin .admin-service-rotate-stepup {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(220px, 1.2fr);
  align-items: end;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  background: var(--admin-soft);
}

.page-admin .admin-service-rotate-stepup strong {
  align-self: center;
  font-size: 13px;
}

.page-admin .admin-service-rotate-stepup label {
  display: grid;
  gap: 5px;
}

.page-admin .admin-service-rotate-stepup label > span {
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-inline-create-form {
  grid-template-columns: 1fr 1.3fr 110px auto;
}

.page-admin .admin-inline-create-form-tags {
  grid-template-columns: 1fr 110px auto;
}

.page-admin .admin-governance-filters label,
.page-admin .admin-service-account-form label,
.page-admin .admin-step-up-fields label,
.page-admin .admin-mfa-setup-details label {
  display: grid;
  gap: 5px;
}

.page-admin .admin-governance-filters label > span,
.page-admin .admin-service-account-form label > span,
.page-admin .admin-step-up-fields label > span,
.page-admin .admin-mfa-setup-details label > span {
  color: var(--admin-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.page-admin .admin-governance-table-shell {
  min-height: 190px;
}

.page-admin .admin-governance-table {
  min-width: 900px;
}

.page-admin .admin-governance-table td {
  vertical-align: top;
}

.page-admin .admin-governance-table td > strong,
.page-admin .admin-governance-table td > span {
  display: block;
  overflow-wrap: anywhere;
}

.page-admin .admin-governance-table td > span {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-security-alert {
  display: grid;
  grid-template-columns: 8px minmax(220px, 1.1fr) minmax(150px, 0.7fr) minmax(340px, 1.5fr);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
}

.page-admin .admin-security-alert::before {
  width: 5px;
  height: 100%;
  min-height: 58px;
  border-radius: 3px;
  background: #819391;
  content: "";
}

.page-admin .admin-security-alert.is-critical::before,
.page-admin .admin-security-alert.is-high::before {
  background: var(--gov-red);
}

.page-admin .admin-security-alert.is-medium::before {
  background: var(--gov-amber);
}

.page-admin .admin-security-alert.is-low::before {
  background: var(--gov-blue);
}

.page-admin .admin-security-alert-copy,
.page-admin .admin-security-alert-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.page-admin .admin-security-alert-copy strong {
  color: var(--admin-ink);
}

.page-admin .admin-security-alert-copy span,
.page-admin .admin-security-alert-meta span {
  overflow-wrap: anywhere;
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-security-alert-actions {
  display: grid;
  grid-template-columns: 150px minmax(140px, 1fr) auto;
  gap: 8px;
}

.page-admin .admin-one-time-secret {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.4fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #e7bd72;
  border-left: 4px solid var(--gov-amber);
  border-radius: 7px;
  background: var(--gov-amber-soft);
}

.page-admin .admin-one-time-secret[hidden] {
  display: none;
}

.page-admin .admin-one-time-secret > div {
  display: grid;
  gap: 3px;
}

.page-admin .admin-one-time-secret span {
  color: #7a541a;
  font-size: 11px;
}

.page-admin .admin-service-table input,
.page-admin .admin-service-table select {
  min-width: 130px;
}

.page-admin .admin-service-actions {
  display: flex;
  gap: 6px;
}

.page-admin .admin-taxonomy-item {
  grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1.2fr) 100px 74px auto;
  align-items: center;
  gap: 8px;
}

.page-admin .admin-taxonomy-item.is-tag {
  grid-template-columns: minmax(120px, 1fr) 100px 74px auto;
}

.page-admin .admin-taxonomy-count {
  color: var(--admin-muted);
  font-size: 11px;
  white-space: nowrap;
}

.page-admin .admin-step-up-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d8c08b;
  border-left: 3px solid var(--gov-amber);
  border-radius: 6px;
  background: #fffaf0;
}

.page-admin .admin-step-up-copy {
  display: grid;
  gap: 3px;
}

.page-admin .admin-step-up-copy span {
  color: #775b2e;
  font-size: 12px;
}

.page-admin .admin-step-up-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.page-admin .admin-user-governance-section {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #fff;
}

.page-admin .admin-user-governance-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.page-admin .admin-user-governance-heading > div:last-child {
  display: flex;
  gap: 8px;
}

.page-admin .admin-user-governance-heading span {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-session-item,
.page-admin .admin-password-history-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.page-admin .admin-mfa-modal {
  width: min(620px, calc(100vw - 28px));
}

.page-admin .admin-mfa-intro,
.page-admin .admin-mfa-setup-details,
.page-admin .admin-mfa-recovery {
  display: grid;
  gap: 9px;
}

.page-admin .admin-mfa-intro span,
.page-admin .admin-mfa-recovery span {
  color: var(--admin-muted);
  font-size: 12px;
}

.page-admin .admin-mfa-intro button {
  justify-self: start;
}

.page-admin .admin-mfa-recovery {
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #f7faf9;
}

.page-admin .admin-mfa-recovery pre {
  max-height: 160px;
  margin: 0;
  overflow: auto;
  color: var(--admin-ink);
  font: 700 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 1120px) {
  .page-admin .admin-governance-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-admin .admin-governance-lower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .admin-service-account-form,
  .page-admin .admin-service-rotate-stepup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .admin-service-account-form > button {
    justify-self: start;
  }

  .page-admin .admin-governance-filters {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .page-admin .admin-security-alert {
    grid-template-columns: 8px minmax(180px, 1fr) minmax(130px, 0.6fr);
  }

  .page-admin .admin-security-alert-actions {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .page-admin .admin-mfa-banner {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .page-admin .admin-mfa-banner > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .page-admin .admin-governance-head,
  .page-admin .admin-user-governance-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-admin .admin-governance-refresh {
    width: 100%;
    justify-content: flex-start;
  }

  .page-admin .admin-governance-kpis,
  .page-admin .admin-governance-chart-grid,
  .page-admin .admin-governance-lower-grid,
  .page-admin .admin-taxonomy-grid,
  .page-admin .admin-step-up-fields,
  .page-admin .admin-governance-filters,
  .page-admin .admin-security-filters,
  .page-admin .admin-service-account-form,
  .page-admin .admin-service-rotate-stepup,
  .page-admin .admin-inline-create-form,
  .page-admin .admin-inline-create-form-tags {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-admin .admin-governance-chart {
    height: 190px;
  }

  .page-admin .admin-taxonomy-item,
  .page-admin .admin-taxonomy-item.is-tag {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .page-admin .admin-taxonomy-item > input:nth-of-type(2),
  .page-admin .admin-taxonomy-item > .admin-taxonomy-count {
    grid-column: 1 / -1;
  }

  .page-admin .admin-security-alert {
    grid-template-columns: 7px minmax(0, 1fr);
    align-items: start;
  }

  .page-admin .admin-security-alert-meta,
  .page-admin .admin-security-alert-actions {
    grid-column: 2;
  }

  .page-admin .admin-security-alert-actions,
  .page-admin .admin-one-time-secret,
  .page-admin .admin-session-item,
  .page-admin .admin-password-history-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-admin .admin-user-governance-heading > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* Account governance filters and modal-driven batch operations. */
.page-admin .admin-user-filter-bar,
.page-admin .admin-user-batch-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) repeat(6, minmax(130px, 0.8fr)) auto;
  align-items: center;
  gap: 6px;
  margin: 7px 0;
  padding: 7px;
  border: 1px solid var(--line);
  background: var(--panel-soft, #f7faf9);
}

.page-admin .admin-user-filter-bar label {
  min-width: 0;
  margin: 0;
}

.page-admin .admin-user-filter-bar input,
.page-admin .admin-user-filter-bar select {
  width: 100%;
  min-height: 34px;
  margin: 0;
}

.page-admin [hidden] {
  display: none !important;
}

.page-admin .admin-user-batch-bar {
  grid-template-columns: max-content max-content;
  justify-content: start;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px;
}

.page-admin .admin-user-batch-primary-actions,
.page-admin .admin-user-batch-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.page-admin .admin-user-batch-primary-actions {
  white-space: nowrap;
}

.page-admin .admin-user-batch-primary-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
}

.page-admin .admin-user-batch-primary-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-admin .admin-user-batch-summary {
  justify-content: flex-start;
}

.page-admin .admin-user-batch-selection {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.page-admin .admin-user-batch-selection strong {
  color: var(--brand, #008b86);
}

.page-admin .admin-user-batch-modal-body {
  display: grid;
  gap: 14px;
}

.page-admin .admin-user-batch-modal-body label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.page-admin .admin-user-batch-modal-body .admin-billing-unlimited-option {
  display: inline-flex;
}

.page-admin #adminUserBatchUnlimitedField .admin-billing-unlimited-option,
.page-admin #adminUserBatchUnlimitedField .admin-billing-unlimited-option:has(input:checked) {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.page-admin .admin-credit-shortcuts {
  display: grid;
  gap: 8px;
}

.page-admin .admin-credit-shortcuts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--admin-ink);
  font-size: 13px;
  font-weight: 750;
}

.page-admin .admin-credit-shortcut-add {
  display: inline-flex;
  width: auto;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--brand, #008b86);
  font-size: 12px;
}

.page-admin .admin-credit-shortcut-add svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.page-admin .admin-credit-shortcut-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.page-admin .admin-credit-shortcut {
  position: relative;
  min-width: 0;
  border: 1px solid var(--admin-line);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.page-admin .admin-credit-shortcut-apply {
  display: grid;
  width: 100%;
  min-height: 54px;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 7px 25px 7px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--admin-ink);
  text-align: left;
}

.page-admin .admin-credit-shortcut-apply span {
  max-width: 100%;
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-admin .admin-credit-shortcut-apply strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.page-admin .admin-credit-shortcut:has(.admin-credit-shortcut-apply:hover),
.page-admin .admin-credit-shortcut:has(.admin-credit-shortcut-apply:focus-visible) {
  border-color: color-mix(in srgb, var(--brand, #008b86) 55%, var(--admin-line));
  background: #f4f9f8;
}

.page-admin .admin-credit-shortcut-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--admin-muted);
}

.page-admin .admin-credit-shortcut-remove svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.page-admin .admin-credit-shortcut-remove:hover {
  color: var(--danger, #c62828);
}

.page-admin .admin-credit-shortcut-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) auto;
  align-items: end;
  gap: 7px;
  padding: 9px;
  border-left: 2px solid var(--brand, #008b86);
  background: var(--panel-soft, #f4f8f7);
}

.page-admin .admin-credit-shortcut-form label {
  gap: 4px;
}

.page-admin .admin-credit-shortcut-form label > span {
  color: var(--admin-muted);
  font-size: 11px;
}

.page-admin .admin-credit-shortcut-form input {
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
}

.page-admin .admin-credit-shortcut-form button {
  width: auto;
  min-height: 34px;
  padding: 6px 11px;
}

.page-admin .admin-credit-shortcut-msg {
  min-height: 16px;
  color: var(--danger, #c62828);
  font-size: 11px;
}

@media (max-width: 560px) {
  .page-admin .admin-credit-shortcut-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .admin-credit-shortcut-form {
    grid-template-columns: 1fr 1fr;
  }

  .page-admin .admin-credit-shortcut-form button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.page-admin .admin-user-batch-modal-body textarea {
  min-height: 92px;
  resize: vertical;
}

.page-admin .admin-user-batch-modal-summary {
  padding: 11px 12px;
  border-left: 3px solid var(--brand, #008b86);
  background: var(--panel-soft, #f4f8f7);
  color: var(--admin-muted);
}

.page-admin .admin-user-batch-modal-summary strong {
  color: var(--ink, #193248);
}

.page-admin .admin-user-select-heading,
.page-admin .admin-user-select-cell {
  width: 42px !important;
  text-align: center !important;
}

.page-admin .admin-user-select-cell input,
.page-admin .admin-user-select-heading input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.page-admin #secUsers .admin-user-table th:nth-child(2),
.page-admin #secUsers .admin-user-table th:nth-child(3) {
  width: 13%;
}

.page-admin #secUsers .admin-user-table th:nth-child(4),
.page-admin #secUsers .admin-user-table th:nth-child(5) {
  width: 7%;
}

.page-admin #secUsers .admin-user-table th:nth-child(6) {
  width: 16%;
}

.page-admin #secUsers .admin-user-table th:nth-child(7),
.page-admin #secUsers .admin-user-table th:nth-child(8),
.page-admin #secUsers .admin-user-table th:nth-child(9) {
  width: 6%;
  text-align: center;
}

.page-admin #secUsers .admin-user-table th:nth-child(10) {
  width: 8%;
  text-align: right;
}

.page-admin .admin-user-danger-section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #dc2626;
  background: #fff7f7;
}

.page-admin .admin-user-danger-section strong {
  color: #991b1b;
}

.page-admin .admin-user-badge-locked {
  color: #9f1239;
  border-color: #fda4af;
  background: #fff1f2;
}

.page-admin .admin-user-badge-deleted {
  color: #fff;
  border-color: #7f1d1d;
  background: #7f1d1d;
}

.page-admin .admin-purge-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.page-admin .admin-purge-preview strong {
  flex-basis: 100%;
}

.page-admin .admin-purge-preview span {
  padding: 5px 8px;
  border: 1px solid #fecaca;
  background: #fff;
  font-size: 13px;
}

.page-admin .admin-purge-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.page-admin .admin-purge-form label {
  margin: 0;
}

.page-admin .admin-purge-form label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.page-admin .admin-purge-form button {
  grid-column: 1 / -1;
  justify-self: end;
}

/* Admin preferences use the shared site state but keep their own accessible menu. */
.page-admin .admin-language-menu {
  position: static;
}

.page-admin .admin-language-panel {
  position: absolute;
  top: 56px;
  right: 0;
  display: grid;
  width: min(240px, calc(100vw - 28px));
  gap: 5px;
  padding: 8px;
  color: #effff9;
  border: 1px solid rgba(117, 241, 211, 0.22);
  border-radius: 8px;
  background: rgba(5, 18, 17, 0.985);
  box-shadow: 0 24px 64px rgba(3, 18, 16, 0.28);
}

.page-admin .admin-language-panel[hidden] {
  display: none;
}

.page-admin .admin-language-panel button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: rgba(237, 255, 249, 0.78);
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.page-admin .admin-language-panel button:hover,
.page-admin .admin-language-panel button:focus-visible {
  color: #fff;
  border-color: rgba(117, 241, 211, 0.24);
  background: rgba(255, 255, 255, 0.07);
}

.page-admin .admin-language-panel button[aria-checked="true"] {
  color: #fff;
  border-color: rgba(117, 241, 211, 0.34);
  background: rgba(12, 154, 154, 0.2);
}

.page-admin .admin-language-panel button[aria-checked="true"]::before {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #5de29b;
  box-shadow: 0 0 0 3px rgba(93, 226, 155, 0.12);
  content: "";
}

.page-admin .admin-language-panel button[aria-checked="true"] span {
  grid-column: 1;
  grid-row: 1;
  padding-left: 15px;
}

.page-admin .admin-language-panel small {
  color: rgba(237, 255, 249, 0.52);
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 1180px) {
  .page-admin .admin-user-filter-bar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .page-admin .admin-user-batch-bar {
    grid-template-columns: max-content max-content;
    align-items: center;
  }
}

@media (max-width: 720px) {
  .page-admin .admin-user-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .page-admin .admin-user-auth-methods {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-user-auth-heading,
  .page-admin .admin-user-auth-email,
  .page-admin .admin-user-auth-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .page-admin .admin-user-filter-bar label:first-child {
    grid-column: 1 / -1;
  }

  .page-admin .admin-user-batch-bar {
    grid-template-columns: 1fr;
  }

  .page-admin .admin-user-batch-primary-actions,
  .page-admin .admin-user-batch-summary {
    grid-column: 1;
  }

  .page-admin .admin-user-batch-primary-actions {
    grid-row: auto;
    flex-wrap: wrap;
  }

  .page-admin .admin-user-batch-primary-button {
    flex: 1 1 calc(50% - 3px);
  }

  .page-admin .admin-user-batch-summary {
    grid-row: auto;
  }

  .page-admin .admin-purge-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-admin :is(
    #adminMobileNavClose,
    .secret-toggle,
    .admin-model-chip-remove,
    .admin-model-chip-order
  ) {
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
  }

  .page-admin :is(
    .admin-mobile-nav-toggle,
    .admin-nav button,
    .admin-sidebar-actions > a,
    .admin-sidebar-actions > button,
    .admin-public-links > .btn.ghost,
    #secUsers .admin-account-tab,
    #secPricing .admin-compact-button,
    #secPricing .admin-billing-actions button
  ) {
    min-height: 44px;
    height: auto;
  }

  .page-admin :is(
    .admin-user-filter-bar input,
    .admin-user-filter-bar select,
    .admin-user-batch-bar input,
    .admin-user-batch-bar select,
    #secPricing .admin-billing-toolbar input,
    #secPricing .admin-billing-toolbar select,
    label.switch
  ) {
    min-height: 44px;
  }

  .page-admin .admin-mobile-nav-toggle {
    max-width: calc(100vw - 212px);
  }

  .page-admin #adminMobileCurrentLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-admin :is(
    .admin-nav,
    .admin-sidebar-actions,
    .admin-public-links,
    .admin-page-actions,
    .admin-task-actions,
    .admin-modal-actions,
    .persona-dashboard-action-buttons
  ) {
    gap: 8px;
  }
}

/* Keep dense admin data usable on phones by scrolling inside bounded sections. */
@media (max-width: 760px) {
  .page-admin .admin-governance-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .page-admin .admin-governance-kpi {
    min-height: 96px;
    padding: 10px;
  }

  .page-admin .admin-governance-kpi > strong {
    font-size: clamp(18px, 6vw, 24px);
  }

  .page-admin :is(
    .admin-governance-chart-grid,
    .admin-governance-lower-grid
  ) {
    max-height: min(62dvh, 520px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .page-admin :is(.table-wrap, .admin-table-shell) {
    max-height: min(68dvh, 600px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .page-admin #taskList {
    max-height: min(68dvh, 600px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .page-admin :is(
    .admin-runtime-stack,
    .admin-runtime-grid,
    .admin-runtime-column
  ) {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .page-admin :is(
    .admin-runtime-stack > *,
    .admin-runtime-panel,
    .admin-runtime-card
  ) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .page-admin .admin-runtime-panel {
    overflow-x: clip;
  }

  .page-admin .admin-user-table td:last-child .admin-user-icon-button {
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .page-admin #secRuntime #btnSaveRuntime {
    min-height: 44px;
  }

  .page-admin .sentiment-cookie-editor .admin-create-actions {
    flex-wrap: wrap;
  }

  .page-admin .sentiment-cookie-editor .admin-create-actions > button {
    flex: 1 1 180px;
    min-width: 0;
  }

  .page-admin .admin-model-add-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .page-admin .modal-overlay {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    overscroll-behavior: contain;
  }

  .page-admin .modal-card {
    max-height: 100%;
  }

}

/* Desktop operations workspace: cap the reading width and keep the utility
   controls as one coherent icon group. */
@media (min-width: 1181px) {
  .page-admin .main {
    width: min(1480px, calc(100% - 48px));
    max-width: 1480px;
    margin-inline: auto;
    padding-block: 14px 24px;
  }
}

.page-admin .admin-profile-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-admin .admin-language-menu {
  display: flex;
  align-items: center;
}

.page-admin .admin-preference-button.admin-language-toggle {
  flex: 0 0 auto;
}

:root .page-admin .admin-profile-menu :is(.admin-language-toggle, .site-user) {
  display: grid;
  inline-size: 38px;
  block-size: 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  color: #effff9;
  border: 1px solid rgba(218, 255, 243, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  line-height: 0;
}

:root .page-admin .admin-profile-menu .site-user {
  border-radius: 50%;
}

@media (min-width: 761px) {
  .page-admin .sidebar {
    z-index: 90;
  }

  .page-admin .admin-profile-menu {
    z-index: 100;
  }

  :root .page-admin .admin-profile-menu :is(.admin-language-toggle, .site-user) {
    color: #19394a;
    border-color: #b8cbd7;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(20, 45, 60, 0.1);
  }
}

:root .page-admin .admin-profile-menu :is(.admin-language-toggle, .site-user):hover,
:root .page-admin .admin-profile-menu .admin-language-toggle[aria-expanded="true"],
:root .page-admin .admin-profile-menu .site-account-menu.is-open .site-user {
  color: #ffffff;
  border-color: rgba(117, 241, 211, 0.34);
  background: rgba(12, 154, 154, 0.16);
}

@media (min-width: 761px) {
  :root .page-admin .admin-profile-menu :is(.admin-language-toggle, .site-user):hover,
  :root .page-admin .admin-profile-menu .admin-language-toggle[aria-expanded="true"],
  :root .page-admin .admin-profile-menu .site-account-menu.is-open .site-user {
    color: #0f4554;
    border-color: #5f92a3;
    background: #eef7f7;
  }
}

:root .page-admin .admin-profile-menu :is(.admin-language-toggle, .site-user) svg {
  inline-size: 21px;
  block-size: 21px;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-admin .admin-list-pagination[hidden] {
  display: none;
}

.page-admin .admin-list-pagination {
  border-top: 1px solid var(--admin-line);
}

/* System configuration uses the same provider-workspace language as Proxy-Cheap procurement. */
:root .page-admin .admin-runtime-provider-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 18px;
  color: #f7fbff;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(105deg, #237fb2 0 8%, #155f96 24%, #123f69 56%, #102c47 100%);
}

:root .page-admin .admin-runtime-provider-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  top: -95px;
  right: -64px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

:root .page-admin .admin-runtime-provider-shell > .admin-runtime-panel-head {
  position: relative;
  z-index: 1;
}

:root .page-admin .admin-runtime-provider-shell > .admin-runtime-panel-head .admin-config-card-title {
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 16px;
}

:root .page-admin .admin-runtime-provider-shell > .admin-runtime-panel-head .small {
  color: #c5dbe9;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(4, 28, 52, 0.3);
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tabs::-webkit-scrollbar {
  display: none;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  white-space: nowrap;
  color: #dcecf6;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab.is-active {
  color: #123f69;
  border-color: rgba(255, 255, 255, 0.72);
  background: #ffffff;
  box-shadow: none;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab.has-attention:not(.is-active)::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: #70e2f0;
  box-shadow: 0 0 0 3px rgba(112, 226, 240, 0.18);
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab-panels {
  position: relative;
  z-index: 1;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab-panel {
  min-width: 0;
  padding: 18px;
  color: #17202a;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: none;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab-panel > .admin-config-card-title,
:root .page-admin .admin-runtime-provider-shell .proxy-provider-api-title-row .admin-config-card-title {
  color: #17202a;
  font-size: 15px;
}

:root .page-admin .admin-runtime-provider-shell .admin-model-tab-panel .small,
:root .page-admin .admin-runtime-provider-shell .proxy-provider-secret-note {
  color: #51677c;
}

:root .page-admin .proxy-provider-api-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

:root .page-admin .proxy-provider-tab-panel .proxy-provider-api-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d6e0e8;
}

@media (max-width: 760px) {
  .page-admin .admin-profile-menu {
    gap: 6px;
  }

  :root .page-admin .admin-runtime-provider-shell {
    padding: 12px;
  }

  :root .page-admin .admin-runtime-provider-shell .admin-model-tab-panel {
    padding: 14px;
  }

  :root .page-admin .proxy-provider-api-title-row,
  :root .page-admin .proxy-provider-api-head,
  :root .page-admin .proxy-provider-credential-actions {
    align-items: stretch;
    flex-direction: column;
  }

  :root .page-admin .proxy-provider-secret-note {
    flex: 0 0 auto;
  }

  :root .page-admin .proxy-provider-api-head button,
  :root .page-admin .proxy-provider-credential-actions button {
    width: 100%;
  }
}

/* billing modal: confirm above ledger, compact shortcuts + unlimited */
.page-admin .admin-public-action-modal {
  z-index: 140;
}
.page-admin #userBillingModal .admin-billing-unlimited-option {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content !important;
  max-width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  white-space: nowrap;
}
.page-admin #userBillingModal .admin-billing-unlimited-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: #176b4d;
}
.page-admin #userBillingModal .admin-credit-shortcut-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.page-admin #userBillingModal .admin-credit-shortcut {
  min-height: 58px;
}
.page-admin #userBillingModal .admin-credit-shortcut-apply {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  min-height: 58px;
  padding: 10px 28px 10px 10px;
}
.page-admin #userBillingModal .admin-credit-shortcut-apply span,
.page-admin #userBillingModal .admin-credit-shortcut-apply strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.page-admin #userBillingModal .admin-credit-shortcut-remove {
  top: 6px;
  right: 6px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
}
.page-admin #userBillingModal .admin-billing-adjust-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}
.page-admin #userBillingModal #billingUserMsg {
  min-height: 18px;
}
