:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-2: #0b111c;
  --surface: #101824;
  --surface-2: #131e2d;
  --surface-3: #182436;
  --text: #ecf3f8;
  --text-strong: #ffffff;
  --muted: #95a4b8;
  --muted-2: #6f8097;
  --border: rgba(148, 163, 184, .18);
  --border-strong: rgba(148, 163, 184, .3);
  --primary: #2f80ff;
  --primary-strong: #76a9ff;
  --primary-soft: rgba(47, 128, 255, .16);
  --accent: #4f9cff;
  --accent-soft: rgba(79, 156, 255, .15);
  --danger: #f05252;
  --danger-strong: #ff6b6b;
  --danger-soft: rgba(240, 82, 82, .14);
  --warning: #f5b84b;
  --warning-soft: rgba(245, 184, 75, .14);
  --success: #76d99b;
  --success-soft: rgba(34, 197, 94, .14);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 28px rgba(0, 0, 0, .22);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, .34);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 4px rgba(47, 128, 255, .2);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-2: #e8eef7;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef3fa;
  --text: #182233;
  --text-strong: #0b1220;
  --muted: #526177;
  --muted-2: #718096;
  --border: rgba(82, 97, 119, .22);
  --border-strong: rgba(82, 97, 119, .34);
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, .11);
  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, .12);
  --danger: #dc2626;
  --danger-strong: #b91c1c;
  --danger-soft: rgba(220, 38, 38, .11);
  --warning: #b7791f;
  --warning-soft: rgba(245, 158, 11, .14);
  --success: #047857;
  --success-soft: rgba(16, 185, 129, .12);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .72) inset, 0 10px 24px rgba(15, 23, 42, .08);
  --shadow-md: 0 18px 48px rgba(15, 23, 42, .14);
  --focus: 0 0 0 4px rgba(37, 99, 235, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(47, 128, 255, .08), transparent 340px),
    linear-gradient(120deg, rgba(79, 156, 255, .08), transparent 420px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

:root[data-theme="light"] code,
:root[data-theme="light"] pre,
:root[data-theme="light"] .credential-value {
  background: rgba(241, 245, 249, .92);
}

:root[data-theme="light"] .btn {
  background: rgba(255, 255, 255, .88);
}

:root[data-theme="light"] .btn-primary {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
}

:root[data-theme="light"] .footer {
  background: rgba(255, 255, 255, .86);
}

:root[data-theme="light"] .logout-link {
  color: #b91c1c;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}
code {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .24);
  color: var(--text-strong);
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}
p { margin: 0; }
pre { overflow: auto; max-width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(0, 0, 0, .28); color: var(--text); }
.hidden { display: none !important; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, .58);
}

.modal-panel {
  width: min(880px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.modal-panel-sm {
  width: min(520px, 100%);
}

.modal-panel form {
  display: grid;
  gap: 18px;
}

.modal-panel [data-password-step],
.modal-panel [data-totp-step],
.modal-panel [data-email-change-step],
.modal-panel [data-admin-sensitive-step] {
  display: grid;
  gap: 18px;
}

.modal-panel [data-totp-step] > .muted {
  margin: 0;
  line-height: 1.45;
}

.modal-panel .form-actions[data-email-change-step],
.modal-panel .auth-actions[data-email-change-step],
.modal-panel .auth-actions-secondary[data-email-change-step] {
  display: flex;
}

.modal-panel .field {
  gap: 7px;
}

.modal-panel .label {
  line-height: 1.25;
}

.modal-panel .form-actions,
.modal-panel .auth-actions,
.modal-panel .auth-actions-secondary {
  margin-top: 8px;
}

.modal-panel .auth-actions {
  gap: 12px;
}

.modal-panel .auth-actions .btn-primary {
  flex: 0 0 auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-header .title {
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 780;
}

.modal-header .subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.auth-method-card {
  margin: 0;
}

.auth-method-fields {
  display: grid;
  gap: 14px;
}

.check-tile {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .035);
}

.check-tile input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.check-tile span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.check-tile strong,
.check-tile small {
  overflow-wrap: anywhere;
}

.check-tile small {
  color: var(--muted);
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 18, .86);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}
.brand, .logo { display: flex; align-items: center; min-width: 0; }
.logo img { display: block; width: 168px; max-height: 44px; object-fit: contain; }
.topnav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.nav-link:hover { color: var(--text-strong); border-color: var(--border); background: rgba(255, 255, 255, .05); text-decoration: none; }
.content { width: min(1220px, calc(100% - 36px)); margin: 32px auto 48px; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.footer { padding: 18px clamp(18px, 4vw, 48px); border-top: 1px solid var(--border); background: rgba(7, 11, 18, .72); color: var(--muted-2); font-size: 13px; }

.card, .auth-card, .error-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(19, 30, 45, .96), rgba(13, 20, 31, .96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.card-body { min-width: 0; padding: clamp(18px, 3vw, 28px); }

.page-header, .title-wrap, .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-header .title, .title-wrap .title, .h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  font-weight: 780;
}
.page-header .subtitle, .title-wrap .subtitle, .muted, .tile-desc, .form-tile-desc { color: var(--muted); }
.page-header .subtitle, .title-wrap .subtitle { margin-top: 5px; font-size: 15px; }
.page-intro {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.page-intro .subtitle { max-width: 760px; color: var(--muted); font-size: 15px; }
.page-header .icon, .title-wrap .icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}
.page-actions, .right-align { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.page-actions form { display: inline-flex; align-items: center; gap: 10px; margin: 0; }

.page-section, .card-section {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.page-section:first-child, .card-section:first-child { border-top: 0; padding-top: 0; }
.page-header + .page-section, .page-header + form > .page-section, .page-intro + .page-section { border-top: 0; padding-top: 0; }
.page-section:last-child, .card-section:last-child { padding-bottom: 0; }
.tenant-token-section .section-card-header { align-items: center; margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.sensitive-diagnostics-table td { vertical-align: top; }
.sensitive-diagnostic-value { display: grid; gap: .65rem; min-width: 13rem; }
.sensitive-diagnostic-status-row, .sensitive-diagnostic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.sensitive-diagnostic-expiration { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sensitive-diagnostic-actions form { margin: 0; }
.sensitive-diagnostic-warning { margin: 0 0 14px; color: var(--danger-strong); font-size: 13px; line-height: 1.45; }
.backups-table { min-width: 1040px; table-layout: fixed; }
.backups-table td { vertical-align: middle; }
.backups-table th:nth-child(1) { width: 252px; }
.backups-table th:nth-child(2) { width: 92px; }
.backups-table th:nth-child(3) { width: 180px; }
.backups-table th:nth-child(5) { width: 92px; }
.backups-table th:nth-child(6) { width: 268px; }
.backups-table td:first-child, .backups-table td:nth-child(5) { white-space: nowrap; }
.backup-version, .backup-hash { display: block; min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.backup-hash { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.backup-hash-control { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.inline-copy-value { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.backup-job-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.backup-job-time { font-size: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; font: 16px/1 sans-serif; }
.icon-btn:hover, .icon-btn[data-copy-state="copied"], button[data-copy-target][data-copy-state="copied"], button[data-copy-value][data-copy-state="copied"] { color: var(--primary-strong); border-color: rgba(47,128,255,.48); background: rgba(47,128,255,.10); }
button[data-copy-target], button[data-copy-value] { position: relative; display: inline-grid; place-items: center; width: 27px; min-width: 27px; height: 27px; min-height: 27px; padding: 0; border-color: var(--border); background: transparent; color: var(--muted); font-size: 0; }
button[data-copy-target]::before, button[data-copy-value]::before,
button[data-copy-target]::after, button[data-copy-value]::after { position: absolute; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; box-sizing: border-box; content: ''; }
button[data-copy-target]::before, button[data-copy-value]::before { transform: translate(2px, -2px); }
button[data-copy-target]::after, button[data-copy-value]::after { transform: translate(-2px, 2px); }
button[data-copy-target][data-copy-state="copied"]::before, button[data-copy-value][data-copy-state="copied"]::before { width: auto; height: auto; border: 0; content: '\2713'; font: 16px/1 sans-serif; transform: none; }
button[data-copy-target][data-copy-state="copied"]::after, button[data-copy-value][data-copy-state="copied"]::after { display: none; }
.backup-key-id { max-width: 100%; margin-top: 6px; overflow: hidden; color: var(--muted); font: 10px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.backup-notes { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-confirmation { display: flex; align-items: flex-start; gap: 9px; color: var(--text-strong); font-size: 13px; font-weight: 700; line-height: 1.4; }
.backup-confirmation input { margin-top: 2px; }
.backup-jobs { display: grid; gap: 8px; margin: 0 0 16px; }
.backup-job { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(245, 184, 75, .07); }
.backup-job-failed { background: rgba(240, 82, 82, .08); }
.backup-job-queued [data-backup-job-title]::before,
.backup-job-running [data-backup-job-title]::before { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; content: ''; animation: backup-job-spin .75s linear infinite; vertical-align: -1px; }
@keyframes backup-job-spin { to { transform: rotate(360deg); } }
.backup-row-actions, .backup-row-actions form { display: flex; align-items: center; gap: 6px; margin: 0; }
.backups-table .backup-row-actions { justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.backup-encryption-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.backup-encryption-actions { display: grid; gap: 8px; }
.backup-active-key-id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 12px; color: var(--text-strong); font-size: 14px; font-weight: 700; line-height: 1.45; }
.backup-active-key-id code { color: var(--text); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.backup-configuration .section-description, .backup-stored-section .section-description, .page-section .section-description { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.backup-split-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
.backup-split-layout > .form { margin-top: 0; }
.backup-split-layout > :nth-child(2) { min-width: 0; padding-left: 28px; border-left: 1px solid var(--border); }
.backup-schedule-form, .backup-retention-form { margin-top: 0; }
.backup-schedule-form .form-actions, .backup-retention-form .form-actions { padding-top: 20px; }
.backup-alert-layout { align-items: start; }
.backup-recipient-add { display: block; margin: 0; }
.backup-recipient-input { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-recipient-input .input { flex: 1 1 220px; min-width: 0; }
.backup-recipient-list { display: grid; gap: 7px; margin: 0; }
.backup-recipient-list > .form-tile-title { margin-bottom: 9px; }
.backup-recipient-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.backup-recipient-list form { margin: 0; }
@media (max-width: 760px) { .backup-split-layout { grid-template-columns: 1fr; } .backup-split-layout > :nth-child(2) { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); padding-top: 20px; } .backup-job { align-items: flex-start; flex-wrap: wrap; } }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.form-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.form-section-header .subtitle,
.section-subtitle { max-width: 880px; margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.form-grid + .form-section-header { margin-top: 30px; }
.field-hint { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.field-info-tooltip { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 5px; border: 1px solid color-mix(in srgb, var(--muted) 58%, transparent); border-radius: 50%; color: color-mix(in srgb, var(--muted) 88%, var(--text)); cursor: help; font: 600 10px/1 sans-serif; letter-spacing: 0; text-transform: none; vertical-align: text-bottom; }
.field-info-tooltip::after { position: absolute; z-index: 20; bottom: calc(100% + 7px); left: 50%; width: 250px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-raised, var(--surface)); box-shadow: 0 8px 20px rgba(0,0,0,.24); color: var(--text); content: attr(data-tooltip); font-family: inherit; font-size: 12px; font-weight: 400; letter-spacing: 0; line-height: 1.4; text-align: left; text-transform: none; white-space: normal; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .15s ease, transform .15s ease; visibility: hidden; }
.field-info-tooltip:hover::after, .field-info-tooltip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
.field-info-tooltip:focus-visible { outline: none; box-shadow: var(--focus); }
.page-header.compact { margin-bottom: 16px; }
#tenant-save-actions { margin: 22px 0 28px; }
.section-title, .form-tile-title, .tile-title, .hp-status-node .title { margin: 0; color: var(--text-strong); font-weight: 760; }
.section-kicker, .label { color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.h2 { margin: 0 0 10px; color: var(--text-strong); font-size: 21px; }
.h3 { margin: 0 0 8px; color: var(--text-strong); font-size: 16px; }

.auth-card { width: min(480px, 100%); margin: 44px auto; padding: clamp(22px, 5vw, 34px); }
.auth-card .h1 { font-size: clamp(26px, 4vw, 38px); }
.form-heading { display: flex; flex-direction: column; gap: 7px; padding-bottom: 12px; }
.error-card { padding: clamp(22px, 4vw, 32px); }

.controller-membership-card {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 7vw, 54px) clamp(26px, 6vw, 44px);
  text-align: center;
  border-color: rgba(79, 156, 255, .3);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .28);
}
.controller-membership-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.controller-membership-card .h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: -.035em;
}
.controller-membership-copy {
  max-width: 410px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.controller-membership-copy strong { color: var(--text-strong); overflow-wrap: anywhere; }
.controller-membership-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 9px 14px;
  border: 1px solid rgba(79, 156, 255, .16);
  border-radius: 999px;
  background: rgba(79, 156, 255, .07);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.controller-membership-dots { display: inline-flex; align-items: center; gap: 4px; }
.controller-membership-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: controller-membership-pulse 1.35s infinite both;
}
.controller-membership-dots i:nth-child(2) { animation-delay: .18s; }
.controller-membership-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes controller-membership-pulse {
  0%, 80%, 100% { opacity: .28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .controller-membership-dots i { animation: none; opacity: .8; }
}

.form, form.form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; width: 100%; }
.form-grid + .form-grid { margin-top: 18px; }
.settings-fields > [hidden] { display: none; }
.settings-fields .field-hint:empty { display: none; }
.settings-choice-group { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.settings-choice-group > label { display: inline-flex; align-items: center; gap: 6px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-2 { grid-column: span 2; }
.form-tile, .detail-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}
.form-tile:has(.table-wrap) { padding: 16px; }
.page-section > .form-grid > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]),
.page-section > form > .form-grid > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]),
.page-section > .section-heading + .form-tile:last-child:not(.danger-zone):not([class*="certificate-"]),
.page-section > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.form-tile-title { margin-bottom: 2px; font-size: 15px; }
.form-tile-desc, .tile-desc { font-size: 13px; line-height: 1.45; }
.certificate-csr-action { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.certificate-csr-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.certificate-csr-action > .action-row { margin-top: 0; }
.certificate-material { display: grid; gap: 14px; min-width: 0; }
.certificate-material .label { font-size: 13px; letter-spacing: 0; text-transform: none; }
.certificate-key-source { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.certificate-key-source > legend { margin-bottom: 6px; }
.certificate-key-option { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .025); cursor: pointer; }
.certificate-key-option:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); background: var(--primary-soft); }
.certificate-key-option:has(input:disabled) { cursor: not-allowed; opacity: .58; }
.certificate-key-option input { flex: 0 0 auto; margin-top: 2px; }
.certificate-key-option span { display: grid; gap: 2px; min-width: 0; }
.certificate-key-option strong { color: var(--text-strong); font-size: 13px; }
.certificate-key-option small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.certificate-replacement-form { margin-top: 18px; }
.certificate-replacement-heading { margin-bottom: 0; }
.certificate-replacement-workflow { display: grid; grid-template-columns: minmax(230px, .7fr) minmax(0, 1.5fr); gap: 20px; align-items: start; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.certificate-replacement-workflow .certificate-csr-action { align-self: stretch; padding: 0 20px 0 0; border-top: 0; border-right: 1px solid var(--border); }
.certificate-service-upload { margin-top: 18px; padding-bottom: 0; border-bottom: 0; }
.certificate-service-upload[hidden] { display: none; }
.certificate-mode-field { margin-bottom: 22px; }
.certificate-source-settings { margin-top: 22px; }
.certificate-service-renewal { margin-top: 18px; }
.certificate-service-renewal .section-heading { margin-bottom: 10px; flex-wrap: wrap; }
.certificate-service-renewal .section-heading .btn-group-hori { margin-top: 0; }
.certificate-page [data-tls-management-form] > .form-actions { margin-bottom: 24px; }
.certificate-renewal-history { margin-top: 16px; }
.certificate-renewal-history .table-wrap { margin-top: 12px; }
.certificate-renewal-history td { overflow-wrap: anywhere; }
.certificate-shared-repair { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.certificate-page [data-certificate-section][hidden],
.certificate-page [data-service-settings][hidden],
.certificate-page [data-service-renewal][hidden],
.certificate-page [data-shared-repair][hidden] { display: none; }
.certificate-material > .certificate-trust-warning { margin: 0; }
.certificate-replacement-actions { margin-top: 0; }
.certificate-transition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.certificate-transition-role { display: grid; align-content: start; gap: 14px; min-width: 0; }
.certificate-transition-role + .certificate-transition-role { padding-left: 24px; border-left: 1px solid var(--border); }
.certificate-transition-role > .btn { justify-self: start; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field > .label,
.field > label.label {
  display: block;
}
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field p { min-height: 26px; color: var(--text); }
.detail-list { display: grid; gap: 10px; margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.detail-row dt { margin: 0; }
.detail-row dd { margin: 0; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.certificate-renewal-completed { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.certificate-renewal-action { margin-top: 0; }
.confirm-summary { margin-top: 8px; }
.status-icon { display: inline-block; width: 24px; height: 24px; vertical-align: middle; }
.text-danger { color: var(--danger-strong); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.input, .select, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 18, .46);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input[type="file"].input {
  padding: 8px 10px;
}
textarea.input { min-height: 180px; resize: vertical; }
.input:focus, .select:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--focus); background: rgba(3, 7, 18, .72); }
.input::placeholder, textarea::placeholder { color: var(--muted-2); }
.input-cb, .input-rb { display: flex; align-items: center; gap: 12px; min-height: 42px; color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

.copy-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.copy-field .input {
  padding-right: 12px;
}

.input-readonly-copy {
  background: rgba(148, 163, 184, .09);
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}

.input-readonly-copy:focus {
  border-color: var(--border);
  box-shadow: none;
  background: rgba(148, 163, 184, .09);
}

.copy-field .btn { flex: 0 0 auto; align-self: center; }

.auth-method-stack {
  display: block;
}

.auth-method-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

.auth-method-section .section-heading {
  margin-bottom: 16px;
}

.auth-status-field {
  width: 220px;
  max-width: 100%;
}

.auth-status-field .select {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.auth-method-fields {
  margin-top: 22px;
}

.auth-method-fields .form-grid {
  align-items: start;
}

.auth-checkbox-field {
  justify-content: flex-start;
  padding-top: 25px;
}

.auth-checkbox-field .input-cb {
  min-height: 42px;
  padding-top: 0;
}

.auth-certificate-preview textarea.input {
  min-height: 118px;
}

.required-mark {
  color: var(--danger-strong);
  margin-left: 3px;
}

.role-assignment-form {
  display: grid;
  grid-template-columns: max-content minmax(260px, 1fr) max-content;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.role-principal-type {
  width: max-content;
  min-width: 150px;
}

.role-principal-type .select {
  width: auto;
  min-width: 150px;
}

.role-principal-value {
  min-width: 0;
}

.role-principal-submit {
  align-self: end;
  white-space: nowrap;
}

.modal-panel .role-assignment-form {
  grid-template-columns: 1fr;
  align-items: stretch;
  margin-bottom: 0;
}

.modal-panel .role-principal-type,
.modal-panel .role-principal-type .select {
  width: 100%;
}

.auth-provider-url-grid {
  gap: 10px;
}

.auth-provider-url-grid .field {
  gap: 4px;
}

.fit-field {
  width: fit-content;
  min-width: 220px;
}

.fit-field .select,
.fit-field .input {
  width: auto;
  min-width: 220px;
}

.modal-panel .auth-provider-fields {
  margin-top: 18px;
}

.action-row, .btn-group-hori, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.action-row-right, .btn-group-hori-right, .form-actions { justify-content: flex-end; }
.provider-form-actions { margin-bottom: 20px; }
.action-stack, .btn-group-vert { display: flex; align-items: stretch; flex-direction: column; gap: 10px; margin-top: 12px; }
.form-actions.left { justify-content: flex-start; }
.modal-header [data-modal-close] { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; font-size: 0; }
.modal-header [data-modal-close]::before,
.modal-header [data-modal-close]::after { position: absolute; width: 14px; height: 1.5px; border-radius: 2px; background: currentColor; content: ''; }
.modal-header [data-modal-close]::before { transform: rotate(45deg); }
.modal-header [data-modal-close]::after { transform: rotate(-45deg); }
.modal-header [data-modal-close]:hover { border-color: var(--border); }
.modal-panel .form-actions, .modal-panel .action-row { justify-content: flex-end; }
.assignment-dialog-header [data-assignment-action^="close"], .assignment-dialog-header [data-attribute-action^="close"], .attribute-dialog-header [data-attribute-action^="close"] { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; font-size: 0; }
.assignment-dialog-header [data-assignment-action^="close"]::before, .assignment-dialog-header [data-assignment-action^="close"]::after,
.assignment-dialog-header [data-attribute-action^="close"]::before, .assignment-dialog-header [data-attribute-action^="close"]::after,
.attribute-dialog-header [data-attribute-action^="close"]::before, .attribute-dialog-header [data-attribute-action^="close"]::after { position: absolute; width: 14px; height: 1.5px; border-radius: 2px; background: currentColor; content: ''; }
.assignment-dialog-header [data-assignment-action^="close"]::before, .assignment-dialog-header [data-attribute-action^="close"]::before, .attribute-dialog-header [data-attribute-action^="close"]::before { transform: rotate(45deg); }
.assignment-dialog-header [data-assignment-action^="close"]::after, .assignment-dialog-header [data-attribute-action^="close"]::after, .attribute-dialog-header [data-attribute-action^="close"]::after { transform: rotate(-45deg); }
.assignment-dialog-header [data-assignment-action^="close"]:hover, .assignment-dialog-header [data-attribute-action^="close"]:hover, .attribute-dialog-header [data-attribute-action^="close"]:hover { border-color: var(--border); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06);
  color: var(--text-strong);
  font: inherit;
  font-weight: 740;
  line-height: 1.1;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-sm { min-height: 34px; padding: 8px 11px; font-size: 13px; }
.btn-icon {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 8px;
}
.btn-icon img {
  display: block;
  width: 24px;
  height: 24px;
}
.btn-primary { border-color: rgba(47, 128, 255, .68); background: linear-gradient(180deg, #3b82f6, #1d4ed8); color: #eef6ff; }
.btn-primary:hover { border-color: var(--primary-strong); background: linear-gradient(180deg, #60a5fa, #2563eb); }
.btn-secondary, .btn-ghost { background: rgba(255, 255, 255, .04); color: var(--text-strong); }
.btn-danger { border-color: rgba(190, 67, 67, .72); background: linear-gradient(180deg, #b44747, #7f2929); color: #fff4f4; }
.btn-danger:hover { border-color: rgba(218, 91, 91, .86); background: linear-gradient(180deg, #c55555, #913232); color: #ffffff; }
.btn[data-busy="1"], .btn[data-disabled="1"], .btn[aria-disabled="true"], .btn.is-disabled, .btn:disabled {
  opacity: .55;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(.2);
}
a.btn[aria-disabled="true"], a.btn.is-disabled {
  pointer-events: auto;
  cursor: not-allowed;
  text-decoration: none;
}
.disabled-tooltip {
  display: inline-flex;
  max-width: 100%;
}
.disabled-tooltip:focus-visible {
  outline: none;
}
.disabled-tooltip:focus-visible .btn {
  box-shadow: var(--focus);
}
.inline { display: inline; margin: 0; }

.alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin: 14px 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
  color: var(--text);
}
.alert-success { border-color: rgba(34, 197, 94, .38); background: var(--success-soft); color: #e9fff1; }
.alert-info { border-color: rgba(79, 156, 255, .34); background: var(--accent-soft); color: #e8f2ff; }
.alert-warning { border-color: rgba(245, 184, 75, .36); background: var(--warning-soft); color: #fff2ce; }
.alert-danger { border-color: rgba(240, 82, 82, .38); background: var(--danger-soft); color: #ffe1e1; }
.command-error-wrap {
  width: 100%;
  min-width: 0;
}
.command-error {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 420px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(240, 82, 82, .3);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 18, .65);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.command-error code {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  white-space: inherit;
  overflow-wrap: inherit;
  word-break: inherit;
}
.alert-nocenter { align-items: flex-start; }
.alert-msg-wrap { min-width: 0; }
.alert-msg-msg { font-weight: 760; }
.alert-msg-ts { color: inherit; opacity: .72; font-size: 12px; }
.alert-btn-wrap { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.alert-text { color: var(--danger-strong); font-weight: 760; }
.template-unsaved-alert {
  align-items: center;
}
.template-unsaved-alert .alert-msg-wrap {
  display: grid;
  gap: 2px;
}
.hint { margin-top: 16px; font-size: 13px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .tile-tag, .table-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.table-status.active, .table-status.is-healthy { border-color: rgba(34, 197, 94, .38); background: var(--success-soft); color: var(--success); }
.table-status.warning, .table-status.is-warning { border-color: rgba(245, 184, 75, .38); background: var(--warning-soft); color: var(--warning); }
.table-status.danger, .table-status.is-danger { border-color: rgba(240, 82, 82, .38); background: var(--danger-soft); color: var(--danger-strong); }
.table-status.disabled, .table-status.is-muted { opacity: .7; }
.table-status.info { border-color: color-mix(in srgb, var(--primary) 38%, transparent); background: var(--primary-soft); color: var(--primary-strong); }
.table-status.compact { min-height: 24px; padding: 3px 8px; font-size: 12px; }
.list { margin: 10px 0 0; padding-left: 18px; }
.list li { margin: 6px 0; }
.grid { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }

.tile-grid, .tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .028));
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.tile:hover { border-color: rgba(47, 128, 255, .5); background: linear-gradient(180deg, rgba(47, 128, 255, .16), rgba(255, 255, 255, .038)); box-shadow: 0 18px 34px rgba(0, 0, 0, .28); text-decoration: none; transform: translateY(-1px); }
.tile:active { transform: translateY(0); }
.tile:focus-visible { outline: none; box-shadow: var(--focus), 0 18px 34px rgba(0, 0, 0, .28); }
.tile[role="link"], .tile[href] { cursor: pointer; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.tile-disabled { opacity: .48; cursor: not-allowed; pointer-events: none; filter: grayscale(.12); }

.toolbar, .table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}
.toolbar form, .toolbar .left, .toolbar .right, .table-toolbar form, .table-toolbar .left, .table-toolbar .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.toolbar .left, .table-toolbar .left { flex: 1 1 auto; }
.toolbar .right, .table-toolbar .right { margin-left: auto; }
.toolbar .input, .table-toolbar .input { width: auto; }
.toolbar input.input[type="text"], .toolbar input.input[type="email"], .toolbar input.input[type="search"], .toolbar input.input[name="q"], .table-toolbar input.input[type="text"], .table-toolbar input.input[name="q"] {
  flex: 1 1 260px;
  width: min(340px, 34vw);
  min-width: 220px;
}
.toolbar .select, .toolbar select, .table-toolbar .select, .table-toolbar select {
  flex: 0 0 auto;
  width: auto;
  min-width: 138px;
  max-width: 220px;
}
.toolbar .btn, .table-toolbar .btn { flex: 0 0 auto; width: auto; }
.toolbar .btn-sm, .table-toolbar .btn-sm { min-height: 42px; }
.table-wrap { min-width: 0; width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(3, 7, 18, .32); }
.table-controls-hump {
  position: sticky;
  left: 0;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  width: 100%;
  min-width: min(100%, 560px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .025);
}
.table-controls-hump .table-controls-toolbar {
  flex: 1 1 420px;
  margin: 0;
  padding: 9px 10px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.table-controls-hump .table-controls-toolbar .input,
.table-controls-hump .table-controls-toolbar .select,
.table-controls-hump .table-controls-toolbar select {
  min-height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13px;
}
.table-controls-hump .table-controls-toolbar .btn,
.table-controls-hump .table-controls-toolbar .btn-sm { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.table-controls-hump .table-filter-action {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}
.table-page-size-control { display: flex; justify-content: flex-end; padding: 7px 10px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .025); }
.table-controls-hump .table-page-size-control {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 7px 10px;
  border-top: 0;
  border-bottom: 0;
  background: transparent;
}
.table-page-size-control label { display: contents; }
.table-page-size-select,
.table-page-size-control .select,
.table-page-size-control select,
.updates-history-controls select,
.analytics-table-wrap [data-cache-page-size] { width: auto; min-width: 0; height: 28px; min-height: 28px; padding: 2px 24px 2px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1.2; }
.table-stable-layout { min-width: 960px; table-layout: fixed; }
.backups-table.table-stable-layout { min-width: 1040px; }
.table-stable-layout td { overflow-wrap: anywhere; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table thead th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .045); color: var(--muted); text-align: left; font-weight: 760; white-space: nowrap; }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid rgba(148, 163, 184, .11); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .035); }
.preferences-settings-table { min-width: 880px; table-layout: fixed; }
.preferences-settings-table th:first-child,
.preferences-settings-table td:first-child { width: 26%; white-space: nowrap; }
.preferences-settings-table th:nth-child(2),
.preferences-settings-table td:nth-child(2) { width: 32%; }
.preferences-settings-table th:nth-child(3),
.preferences-settings-table td:nth-child(3) { width: 42%; white-space: normal; overflow-wrap: anywhere; }
.preferences-settings-table td.preferences-smtp-routing-warning { white-space: normal; overflow-wrap: anywhere; }
.preferences-notification-path-control { display: flex; align-items: center; gap: 8px; width: 100%; }
.preferences-recipient-group { margin-top: 24px; }
#general, #notifications, #smtp-security, #hostnames { scroll-margin-top: 84px; }
.preferences-notification-path-control .input { flex: 1 1 auto; min-width: 0; }
.preferences-notification-path-control .disabled-tooltip,
.preferences-notification-path-control .btn { flex: 0 0 auto; }
.preferences-smtp-whitelist-heading { margin-top: 24px; }
.smtp-connection-intelligence-form .action-row { margin-bottom: 30px; }
.table-compact thead th, .table-compact tbody td { padding: 9px 11px; font-size: 13px; }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions .action-row { justify-content: flex-end; flex-wrap: nowrap; margin-top: 0; }
.table-action-group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.table-action-group form { display: inline-flex; margin: 0; }
.table-action-group .btn { width: auto; }
.row-action-menu { position: fixed; inset: auto; margin: 0; min-width: 180px; max-width: calc(100vw - 16px); padding: 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
.row-action-menu:popover-open { display: grid; }
.row-action-menu:not(:popover-open) { display: none; }
.row-action-menu form, .row-action-menu .disabled-tooltip { display: block; margin: 0; }
.row-action-menu .btn { justify-content: flex-start; box-shadow: none; transform: none; white-space: normal; }
:root .row-action-menu .btn.btn-danger { color: var(--danger-strong); }
.row-action-menu .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.row-action-trigger { white-space: nowrap; }
.record-metadata { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.record-metadata summary { cursor: pointer; }
.record-metadata code { display: block; margin-top: 4px; overflow-wrap: anywhere; white-space: normal; }
.table-empty { height: 102px; padding: 0 !important; text-align: center; color: var(--text-strong); font-size: 13px; font-weight: 760; }
.table-empty > .empty-state {
  display: grid;
  gap: 5px;
  min-height: 102px;
  margin: 0;
  padding: 16px;
  place-content: center;
  color: var(--muted);
  font-weight: 400;
}
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; color: var(--muted); text-align: center; }
.empty-state-title { color: var(--text-strong); font-weight: 760; }
.empty-state-desc { max-width: 520px; font-size: 13px; }
.table-result-summary { margin-top: 10px; font-size: 12px; }
.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; }

/* Slim contextual global search, deliberately denser than page cards. */
.utility-search { position: relative; }
.utility-search-submit { position: absolute; z-index: 1; top: 0; left: 0; width: 38px; height: 38px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.utility-search-submit:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 7px; }
.global-search-dropdown { position: absolute; z-index: 80; top: calc(100% + 7px); left: 0; width: max(100%, 460px); max-width: min(560px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; background: color-mix(in srgb, var(--surface) 96%, #080d18); box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.global-search-result, .global-search-state { display: flex; align-items: center; min-width: 0; height: 36px; gap: 8px; padding: 0 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent); color: var(--text); font-size: 13px; line-height: 1; white-space: nowrap; }
.global-search-result:last-child { border-bottom: 0; }
.global-search-result:hover, .global-search-result.is-active { color: var(--text-strong); background: color-mix(in srgb, var(--primary) 16%, transparent); text-decoration: none; }
.global-search-result:focus-visible { position: relative; z-index: 1; outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.global-search-result-icon { display: inline-flex; flex: 0 0 18px; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.global-search-result-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.global-search-result-type { flex: 0 0 auto; max-width: 118px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.global-search-result-context { min-width: 0; overflow: hidden; color: var(--muted-2); text-overflow: ellipsis; }
.global-search-result-context::before { content: '·'; margin-right: 8px; color: var(--border-strong); }
.global-search-result-status { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 11px; }
.global-search-state { color: var(--muted); }
.global-search-state.is-error { color: var(--danger-strong); }
.search-results-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) max-content; align-items: end; gap: 12px; margin-bottom: 16px; }
.search-results-summary { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.search-result-name { color: var(--text-strong); font-weight: 750; }
.search-match-field { display: block; color: var(--muted); font-size: 12px; }
.search-match-value { display: block; max-width: 250px; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.search-results-table td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .certificate-transition-grid { grid-template-columns: 1fr; }
  .certificate-transition-role + .certificate-transition-role { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .certificate-replacement-workflow { grid-template-columns: 1fr; }
  .certificate-replacement-workflow .certificate-csr-action { padding: 0 0 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .certificate-key-source { grid-template-columns: 1fr; }
  .global-search-dropdown { position: fixed; top: 56px; right: 12px; left: 12px; width: auto; max-width: none; }
  .search-results-toolbar { grid-template-columns: 1fr; }
  .search-results-table { min-width: 780px; }
}
.th-sort a { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.th-sort a:hover { color: var(--text-strong); text-decoration: none; }
.th-sort a:focus-visible, .pager a:focus-visible, .pager button:focus-visible, .side-nav-link:focus-visible, .side-nav-sublink:focus-visible, .side-nav-parent:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.sort-ind { opacity: .72; font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pager > a, .pager > span:not(.pager-page-numbers):not(.sr-only):not(.table-pagination-summary), .pager > button, .pager-page-numbers > a, .pager-page-numbers > span, .pager-page-numbers > button { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .045); color: var(--text); font: inherit; font-weight: 700; }
.pager a:hover, .pager button:hover { border-color: var(--primary); color: var(--primary-strong); text-decoration: none; }
.pager .current { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.pager .disabled { opacity: .45; pointer-events: none; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager-page-numbers { display: inline-flex; align-items: center; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, .035); }
.stat-value { color: var(--text-strong); font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.danger-zone { border-color: rgba(240, 82, 82, .35); background: rgba(240, 82, 82, .07); }

.summary-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.summary-grid + .form-grid { margin-top: 18px; }
form[data-tls-management-form] + form[data-tls-renewal-form] { margin-top: 18px; }
form[data-tls-renewal-form] + .form-grid { margin-top: 18px; }
.summary-card {
  grid-column: span 3;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .024));
}
.summary-card-wide { grid-column: span 6; }
.summary-label { color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.summary-value { margin-top: 8px; color: var(--text-strong); font-size: 22px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.summary-desc { margin-top: 6px; color: var(--muted); font-size: 13px; }

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(47, 128, 255, .12), rgba(255, 255, 255, .028));
}
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(47, 128, 255, .38);
  border-radius: var(--radius);
  background: rgba(47, 128, 255, .16);
  color: var(--primary-strong);
  font-size: 18px;
  font-weight: 840;
}
.profile-title { color: var(--text-strong); font-size: 22px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.profile-subtitle { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.profile-hero .pill-row { justify-content: flex-end; margin-top: 0; }

.admin-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.admin-action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .032);
}
.admin-action-card > .btn, .admin-action-card > form { margin-top: auto; }
.admin-action-card > [id$="_wrapper"]:not(.hidden) { display: grid; gap: 10px; }
.admin-action-card .field + .field { margin-top: 10px; }
.admin-action-card .action-row { margin-top: 12px; }
.admin-action-card > .action-row { margin-top: auto; }
.profile-preferences-form { margin: 0; }

.credential-panel {
  display: grid;
  gap: 14px;
  width: 100%;
}
.credential-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.credential-title { color: var(--text-strong); font-weight: 800; }
.credential-note { margin-top: 3px; color: var(--muted); font-size: 13px; }
.credential-grid { display: grid; gap: 10px; }
.credential-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 18, .36);
}
.credential-label { color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.credential-value {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .24);
  color: var(--text-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.credential-value.secret { border-color: rgba(245, 184, 75, .24); background: rgba(245, 184, 75, .08); }

body.modal-open { overflow: hidden; }

#preview_subtitle { font-size: 12px; font-style: italic; font-weight: 500; color: var(--muted); }
.template-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0 14px; margin-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.template-editor-routine-actions, .template-lifecycle-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.template-editor-label, .preview-control-label { color: var(--text); font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.template-image-library-button { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.template-lifecycle-actions { padding-left: 14px; border-left: 1px solid var(--border); }
.save-state-success { color: var(--success); font-size: 13px; font-weight: 720; }
.field-error { margin-top: 6px; color: var(--danger-strong); font-size: 13px; font-weight: 700; }
.template-help, .template-source { margin-top: 18px; }
.template-help summary, .template-source summary { cursor: pointer; color: var(--muted); font-weight: 720; }
.template-help[open] > .table-wrap { margin-top: 12px; }
.template-conditional-help[open] { display: grid; gap: 12px; }
.template-conditional-intro { max-width: 900px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.template-conditional-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.template-conditional-item { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .025); }
.template-conditional-item > code { width: fit-content; color: var(--text-strong); font-weight: 750; }
.template-conditional-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.template-conditional-item pre { max-width: 100%; margin: 0; padding: 9px 10px; overflow-x: auto; border-radius: 6px; background: rgba(3, 7, 18, .58); white-space: pre; }
.template-conditional-item pre code { padding: 0; background: transparent; font-size: 12px; }
.template-conditional-rules { padding: 10px 12px; border-left: 2px solid color-mix(in srgb, var(--primary) 55%, var(--border)); color: var(--muted); font-size: 13px; line-height: 1.5; }
.template-conditional-rules strong { color: var(--text-strong); }
.template-source pre { max-height: 360px; overflow: auto; margin: 12px 0 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #080c14; color: #e5e7eb; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-history-table .is-current-live td { background: rgba(58, 190, 123, .08); }
.template-history-table .is-current-view td { box-shadow: inset 0 1px 0 rgba(58, 190, 123, .35), inset 0 -1px 0 rgba(58, 190, 123, .35); }
.template-history-table td { vertical-align: top; }
.template-history-wrap { overflow-x: auto; }
.template-list-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.template-list-version { font-weight: 800; white-space: nowrap; }
.preview-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.preview-panel-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.preview-panel-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.preview-panel-control .label {
  margin: 0;
}
.select-sm {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  padding: 7px 32px 7px 10px;
  font-size: 13px;
}
#html_preview { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.preview-pane { position: relative; min-height: 180px; }
#sigPreview, .sig-preview { display: block; width: 100%; min-height: 180px; border: 0; border-radius: var(--radius-sm); overflow: hidden; }
.preview-text-pane { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: #101828; }
.preview-text-pane pre { box-sizing: border-box; min-height: 180px; margin: 0; padding: 14px; overflow-wrap: anywhere; border: 0; border-radius: 0; background: transparent; color: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
#sig-preview { scrollbar-width: none; }
#sig-preview::-webkit-scrollbar { display: none; }
.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  background: rgba(248, 250, 252, .86);
  color: #344054;
  font-size: 13px;
  font-weight: 760;
  pointer-events: none;
  transition: opacity .16s ease;
}
.preview-pane.is-loading .preview-loading {
  display: flex;
}
.preview-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(52, 64, 84, .22);
  border-top-color: #2f80ff;
  border-radius: 999px;
  animation: preview-spin .75s linear infinite;
}
@keyframes preview-spin {
  to { transform: rotate(360deg); }
}
.preview-settings-fields {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  align-items: stretch;
  gap: 16px;
}
.preview-settings-actions { align-self: start; margin-top: 4px; }
.preview-settings-actions .btn { width: auto; }
.preview-attribute-table { table-layout: fixed; }
.preview-attribute-table th,
.preview-attribute-table td { overflow-wrap: anywhere; vertical-align: top; white-space: normal; }
.preview-attribute-table th:nth-child(1),
.preview-attribute-table td:nth-child(1) { width: 22%; }
.preview-attribute-table th:nth-child(2),
.preview-attribute-table td:nth-child(2) { width: 42%; }
.preview-attribute-token {
  display: inline-block;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, .14);
  color: var(--text-strong);
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.resolution-summary { display: grid; }
.resolution-summary-group {
  padding: 16px 0;
  border-top: 1px solid rgba(148, 163, 184, .12);
}
.resolution-summary-group:first-child { padding-top: 0; border-top: 0; }
.resolution-summary-group:last-child { padding-bottom: 0; }
.resolution-summary-title { margin: 0 0 10px; color: var(--text-strong); font-size: 15px; font-weight: 760; }
.resolution-summary-value { margin: 0; color: var(--text); font-weight: 720; overflow-wrap: anywhere; }
.resolution-summary-detail { margin: 4px 0 0; overflow-wrap: anywhere; }
.resolution-addon-list { display: grid; gap: 14px; margin: 0; padding-left: 22px; }
.resolution-addon-list li { padding-left: 2px; }
#user-attribute-wrapper { width: 100%; }
.helper-header { margin: 16px 0; }
.cm-host { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.cm-editor { background-color: #080c14; color: #e5e7eb; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.45; }
.cm-scroller { min-height: 360px; }
.cm-gutter, .cm-gutters { background: #070b12; }
.cm-gutters { border-right: 1px solid rgba(255, 255, 255, .12); }
.cm-cursor { border-left-color: #f8fafc !important; }
.cm-selectionBackground, .cm-editor.cm-focused .cm-selectionBackground { background: rgba(148, 163, 184, .28); }
.cm-activeLine { background: rgba(255, 255, 255, .05); }
.cm-invalidVar, .cmTok-invalid { color: #fb7185; text-decoration-line: underline; text-decoration-style: wavy; text-decoration-color: #ef4444; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cmTok-tag { color: #67e8f9; } .cmTok-attr { color: #fbbf24; } .cmTok-string { color: #86efac; } .cmTok-comment { color: #c4b5fd; font-style: italic; }
.cm-ifBlock { background-color: rgba(251, 191, 36, .18); } .cm-addonBlock { background-color: rgba(196, 181, 253, .22); }

.session-modal-backdrop[hidden] { display: none; }
.session-modal-backdrop { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(0, 0, 0, .64); }
.session-modal { width: min(420px, 100%); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.session-modal h3 { margin: 0 0 8px; color: var(--text-strong); font-size: 18px; }
.session-modal p { margin: 0 0 16px; color: var(--muted); }
.session-modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.hp-status-node { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hp-status-node .subtitle { color: var(--muted); font-size: 13px; }
.hp-status-node .body { margin-top: 6px; color: var(--muted); font-size: 13px; }
.hp-status-img { display: flex; justify-content: flex-end; }

/* Deterministic template assignment management */
.assignment-management-page .card-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.assignment-slot-state-actions { display: inline-flex; align-items: center; gap: 8px; }
.assignment-slot-configuration { padding-bottom: 18px !important; border-bottom: 1px solid var(--border) !important; }
.assignment-slot-configuration .section-heading { margin-bottom: 0; }
.assignment-feedback:empty { display: none; }
.attribute-management-page .card-body { display: grid; gap: 26px; }
.attribute-feedback:empty { display: none; }
.assignment-section { display: grid; gap: 14px; padding-top: 22px; border-top: 1px solid var(--border); }
.assignment-section:first-of-type { padding-top: 0; border-top: 0; }
.assignment-management-page > .card-body > .assignment-section { padding-top: 0; border-top: 0; }
.assignment-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.assignment-section-heading h2, .assignment-scope-header h3, .assignment-slot-title h3 { margin: 0; color: var(--text-strong); }
.assignment-section-heading p { margin-top: 5px; max-width: 880px; color: var(--muted); line-height: 1.45; }
.attribute-section { display: grid; gap: 14px; }
.attribute-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.attribute-section-heading h2, .attribute-scope-header h3 { margin: 0; color: var(--text-strong); }
.attribute-section-heading p { margin: 5px 0 0; max-width: 880px; color: var(--muted); line-height: 1.45; }
.assignment-base-sections, .assignment-slot-overview { min-width: 0; }
.assignment-scope-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 24px 0; border-top: 1px solid var(--border); }
.assignment-base-sections > .assignment-scope-section:first-child { padding-top: 0; border-top: 0; }
.assignment-slot-overview > .assignment-scope-section:first-child { padding-top: 0; border-top: 0; }
.assignment-scope-heading { margin-bottom: 0; }
.assignment-management-page .section-heading { flex-wrap: wrap; }
.assignment-scope-heading > :first-child { flex: 1 1 360px; min-width: 0; }
.assignment-scope-actions { flex: 0 0 auto; }
.attribute-management-sections { min-width: 0; }
.attribute-scope-section { display: grid; gap: 14px; padding: 24px 0; border-top: 1px solid var(--border); }
.attribute-management-sections > .attribute-scope-section:first-child { padding-top: 0; border-top: 0; }
.attribute-scope-heading { margin-bottom: 0; }
.assignment-schedule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.assignment-schedule-timezone { grid-column: 1 / -1; }
.assignment-row-schedule { min-width: 170px; }
@media (max-width: 760px) { .assignment-schedule-fields { grid-template-columns: 1fr; } }
.assignment-scope-header, .assignment-slot-title, .assignment-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assignment-scope-summary, .attribute-scope-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.assignment-scope-guidance, .attribute-scope-guidance { max-width: 780px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.assignment-table { min-width: 760px; }
.assignment-table thead th, .attribute-table thead th { white-space: normal; overflow-wrap: anywhere; }
.assignment-table .assignment-row.is-sortable { cursor: grab; }
.assignment-table .assignment-row.is-sortable td:first-child { border-left: 3px solid var(--primary); }
.assignment-table .assignment-row.is-search-target td { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.assignment-row.is-dragging { opacity: .55; cursor: grabbing; }
.assignment-row-target, .assignment-row-template { overflow-wrap: anywhere; }
.assignment-secondary-guid { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.assignment-row-tenant { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.assignment-row-template { font-weight: 760; color: var(--text-strong); }
.assignment-problems { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.assignment-order { color: var(--text); font-variant-numeric: tabular-nums; }
.assignment-empty { padding: 24px; color: var(--muted); }
.assignment-table .assignment-empty { text-align: center; }
.assignment-table .table-actions, .assignment-slot-table .table-actions { min-width: 190px; white-space: normal; }
.assignment-table-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.assignment-table-actions .btn { width: auto; margin: 0; }
.assignment-order-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(59, 130, 246, .08); }
.assignment-order-actions[hidden] { display: none; }
.assignment-order-actions .muted { margin-right: auto; }
.assignment-slot-list { display: grid; gap: 14px; }
.assignment-slot-assignment-list { min-width: 0; }
.assignment-slot-overview { display: grid; }
.assignment-slot-title { flex-wrap: wrap; justify-content: flex-start; }
.assignment-slot-syntax { overflow-wrap: anywhere; white-space: normal; }
.attribute-scope-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attribute-table { min-width: 680px; }
.attribute-table:has(.assignment-row-tenant) { min-width: 820px; }
.attribute-table .table-actions { min-width: 170px; white-space: normal; }
.attribute-name { font-weight: 760; color: var(--text-strong); overflow-wrap: anywhere; }
.attribute-target, .attribute-value { overflow-wrap: anywhere; }
.attribute-empty { padding: 12px; text-align: center; color: var(--muted); }
.attribute-table-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.attribute-table-actions .btn { width: auto; margin: 0; }
.attribute-table .attribute-row.is-sortable { cursor: grab; }
.attribute-table .attribute-row.is-sortable td:first-child { border-left: 3px solid var(--primary); }
.assignment-empty-state,
.attribute-empty-state {
  display: grid;
  gap: 5px;
  min-height: 102px;
  place-content: center;
  padding: 16px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.assignment-empty-state strong,
.attribute-empty-state strong { color: var(--text-strong); }
.table-wrap > .assignment-empty-state,
.table-wrap > .attribute-empty-state { border: 0; border-radius: 0; }
.attribute-row.is-dragging { opacity: .55; cursor: grabbing; }
.attribute-order { color: var(--text); font-variant-numeric: tabular-nums; }
.attribute-order-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(59, 130, 246, .08); }
.attribute-order-actions[hidden] { display: none; }
.attribute-order-actions .muted { margin-right: auto; }
.assignment-dialog, .attribute-dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
.assignment-dialog::backdrop, .attribute-dialog::backdrop { background: rgba(0, 0, 0, .62); }
.assignment-dialog-panel, .attribute-dialog-panel { display: grid; gap: 17px; padding: 22px; }
.assignment-dialog-header h2, .attribute-dialog-header h2 { margin: 0; color: var(--text-strong); font-size: 20px; }
.assignment-dialog-header, .attribute-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assignment-dialog-panel #assignment-dialog-fields, .attribute-dialog-panel #attribute-dialog-fields { display: grid; gap: 14px; }
.assignment-target-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assignment-target-controls .input { min-width: 0; flex: 1 1 auto; }
.assignment-directory-dialog { width: min(980px, calc(100% - 32px)); z-index: 20; }
.assignment-directory-search { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: end; }
.assignment-directory-search .form-actions { justify-content: flex-start; margin: 0; }
.assignment-directory-results { min-height: 58px; }
.assignment-directory-table { min-width: 780px; }
.assignment-directory-disabled-reason { display: block; margin-top: 5px; max-width: 180px; font-size: 12px; }
.assignment-enabled-field { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.attribute-overwrite-field { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }

@media (max-width: 980px) {
}

@media (max-width: 680px) {
  .assignment-scope-summary, .attribute-scope-summary, .assignment-scope-header, .assignment-dialog-header, .attribute-scope-header, .attribute-dialog-header { align-items: stretch; flex-direction: column; }
  .assignment-dialog-header [data-assignment-action^="close"], .assignment-dialog-header [data-attribute-action^="close"], .attribute-dialog-header [data-attribute-action^="close"] { align-self: flex-end; }
  .assignment-directory-search { grid-template-columns: 1fr; }
  .assignment-target-controls { align-items: stretch; flex-direction: column; }
  .assignment-table-actions, .attribute-table-actions { justify-content: flex-start; }
  .assignment-order-actions, .attribute-order-actions { align-items: stretch; flex-direction: column; }
  .assignment-order-actions .muted, .attribute-order-actions .muted { margin-right: 0; }
}

@media (max-width: 980px) {
  .content { width: min(100% - 28px, 760px); margin-top: 24px; }
  .tile-grid, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card, .summary-card-wide { grid-column: span 6; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .col-8, .col-6, .col-4, .col-2 { grid-column: span 12; }
  .auth-checkbox-field { padding-top: 0; }
  .role-assignment-form { grid-template-columns: 1fr; }
  .role-principal-type,
  .role-principal-type .select,
  .role-principal-submit { width: 100%; }
  .template-editor-toolbar { align-items: stretch; }
  .template-lifecycle-actions { padding-left: 0; border-left: 0; }
}
  @media (max-width: 680px) {
    .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
    .topnav { width: 100%; justify-content: flex-start; }
  .card-body { padding: 18px; }
  .page-header, .title-wrap, .card-header, .section-card-header, .section-subsection-header, .toolbar, .table-toolbar, .alert { flex-direction: column; align-items: stretch; }
    .tile-grid, .tiles, .field-row, .stat-grid, .permission-grid, .auth-method-grid { grid-template-columns: 1fr; }
  .toolbar form, .toolbar .left, .toolbar .right, .table-toolbar form, .table-toolbar .left, .table-toolbar .right, .action-row, .btn-group-hori, .action-row-right, .btn-group-hori-right, .form-actions, .page-actions, .section-card-header-actions { align-items: stretch; width: 100%; }
  .btn, .page-actions form, .toolbar .input, .toolbar .select, .toolbar select, .table-toolbar .input, .table-toolbar .select, .table-toolbar select { width: 100%; max-width: none; }
  .btn-icon { width: 42px; max-width: 42px; }
  .table-actions { text-align: left; }
  .pager { justify-content: flex-start; }
  .detail-row { grid-template-columns: 1fr; gap: 2px; }
  .summary-grid, .profile-hero, .credential-row { grid-template-columns: 1fr; }
  .summary-card, .summary-card-wide { grid-column: span 12; }
  .credential-header { flex-direction: column; }
}
/* Enterprise console shell */
.app-shell-authed {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(47, 128, 255, .07), transparent 320px),
    linear-gradient(135deg, rgba(79, 156, 255, .06), transparent 460px),
    #070b12;
}

.app-shell-public {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  border-right: 1px solid rgba(148, 163, 184, .16);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(3, 7, 18, .96)),
    #080c14;
  box-shadow: 18px 0 50px rgba(0, 0, 0, .24);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 2px 4px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-mark img {
  display: block;
  width: 138px;
  max-height: 38px;
  object-fit: contain;
}

.brand-meta {
  display: none;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-meta span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.brand-meta strong {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-strong);
  font-size: 13px;
}

.side-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 0;
  scrollbar-color: rgba(118, 169, 255, .56) rgba(255, 255, 255, .035);
  scrollbar-width: thin;
}

.side-nav::-webkit-scrollbar {
  width: 8px;
}

.side-nav::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
}

.side-nav::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(118, 169, 255, .48);
  background-clip: padding-box;
}

.side-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(118, 169, 255, .72);
  background-clip: padding-box;
}

.side-nav-group + .side-nav-group {
  margin-top: 22px;
}

.side-nav-label {
  margin: 0 8px 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.side-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 3px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #aebbd0;
  font-size: 14px;
  font-weight: 720;
}

.side-nav-link:hover {
  color: var(--text-strong);
  border-color: rgba(148, 163, 184, .16);
  background: rgba(255, 255, 255, .045);
  text-decoration: none;
}

.side-nav-link.is-active {
  color: #eef6ff;
  border-color: rgba(47, 128, 255, .38);
  background: linear-gradient(90deg, rgba(47, 128, 255, .22), rgba(47, 128, 255, .07));
  box-shadow: inset 3px 0 0 var(--primary);
}

.side-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 11px;
  font-weight: 840;
  line-height: 1;
}

.side-nav-link.is-active .side-nav-icon {
  border-color: rgba(47, 128, 255, .44);
  background: rgba(47, 128, 255, .2);
  color: var(--primary-strong);
}

.side-nav-nested {
  margin: 3px 0;
}

.side-nav-parent {
  width: 100%;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.side-nav-parent::after {
  content: ">";
  margin-left: auto;
  color: var(--muted-2);
  font-size: 12px;
  transition: transform .16s ease, color .16s ease;
}

.side-nav-nested.is-open > .side-nav-parent::after {
  transform: rotate(90deg);
  color: var(--text-strong);
}

.side-nav-children {
  display: none;
  gap: 2px;
  margin: 4px 0 8px 22px;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, .14);
}

.side-nav-nested.is-open > .side-nav-children {
  display: grid;
}

.side-nav-sublink {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #9facbf;
  font-size: 13px;
  font-weight: 700;
}

.side-nav-sublink:hover {
  color: var(--text-strong);
  border-color: rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .035);
  text-decoration: none;
}

.side-nav-sublink.is-active {
  color: #eef6ff;
  border-color: rgba(47, 128, 255, .34);
  background: rgba(47, 128, 255, .14);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .13);
}

.logout-form {
  margin: 0;
}

.logout-form .logout-link {
  width: 100%;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sidebar-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.logout-link {
  color: #f7b4b4;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.utility-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(160px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px clamp(22px, 4vw, 46px);
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: rgba(7, 11, 18, .8);
  backdrop-filter: blur(18px);
}

.app-shell-authed .utility-bar > * {
  min-width: 0;
}

.utility-bar-left {
  display: flex;
  align-items: center;
}

.app-shell-authed .utility-bar-left {
  min-width: 0;
  gap: 12px;
}

.utility-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 12px;
}

.utility-organization-context {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-search {
  position: relative;
  flex: 0 1 520px;
  width: min(520px, 100%);
  min-width: 0;
}

.utility-search input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 36px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.utility-search input::placeholder {
  color: var(--muted);
}

.utility-search input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--focus);
}

.utility-search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}

.utility-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

.utility-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.utility-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 17px;
  font-weight: 760;
  cursor: pointer;
}

.utility-action:hover {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .055);
  color: var(--text-strong);
  text-decoration: none;
}

.utility-action:focus-visible,
.utility-user-menu summary:focus-visible,
.utility-user-trigger:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.utility-notifications { position: relative; }
.utility-notification-badge { position: absolute; top: -4px; right: -5px; z-index: 1; min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 12px; text-align: center; }
.utility-notifications-panel { position: absolute; z-index: 90; top: calc(100% + 8px); right: 0; width: min(350px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; background: color-mix(in srgb, var(--surface) 97%, #080d18); box-shadow: 0 14px 34px rgba(0, 0, 0, .3); }
.utility-notifications-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--text-strong); font-size: 13px; }
.utility-notifications-heading .muted { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.utility-notifications-list { max-height: 252px; overflow-y: auto; }
.utility-notification-row, .utility-notifications-state { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent); }
.utility-notification-row { color: var(--text); }
.utility-notification-row:hover { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--text-strong); text-decoration: none; }
.utility-notification-row:focus-visible { position: relative; z-index: 1; outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.utility-notification-title, .utility-notification-context { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utility-notification-title { color: var(--text-strong); font-size: 13px; font-weight: 720; }
.utility-notification-context, .utility-notifications-state { color: var(--muted); font-size: 12px; }
.utility-notifications-state { min-height: 48px; justify-content: center; }
.utility-notifications-state.is-error { color: var(--danger-strong); }
.utility-notifications-all { display: block; padding: 10px 12px; color: var(--primary-strong); font-size: 13px; font-weight: 720; }
.utility-notifications-all:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); text-decoration: none; }
.utility-notifications-all:focus-visible { display: block; outline: none; box-shadow: inset 0 0 0 2px var(--primary); }

.utility-user-menu {
  position: relative;
}

.utility-user-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 3px 5px 3px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.utility-user-menu summary::-webkit-details-marker {
  display: none;
}

.utility-user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 3px 5px 3px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.utility-user-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
}

.utility-user-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(45deg);
}

.utility-user-menu[open] summary,
.utility-user-trigger[aria-expanded="true"],
.utility-user-trigger:hover,
.utility-user-menu summary:hover {
  border-color: rgba(148, 163, 184, .18);
  background: rgba(255, 255, 255, .055);
}

.utility-user-menu[open] summary::after,
.utility-user-trigger[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.utility-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .04em;
}

.utility-user-summary {
  max-width: 180px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-user-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(292px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.utility-user-panel[hidden] {
  display: none;
}

.utility-user-identity {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.utility-user-identity strong {
  color: var(--text-strong);
  font-size: 14px;
}

.utility-user-identity span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.utility-menu-divider {
  height: 1px;
  margin: 7px 0;
  background: rgba(148, 163, 184, .16);
}

.utility-menu-item, :root .row-action-menu .btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
}

.utility-menu-item:hover, :root .row-action-menu .btn:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, .14);
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
}

.utility-menu-item-split span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.utility-user-panel form {
  margin: 0;
}

.utility-menu-signout {
  color: var(--danger-strong);
  cursor: pointer;
}

.primary-card-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

/* The page header supplies the divider before the first content section. */
.primary-card-page-header + .page-section {
  border-top: 0;
  padding-top: 0;
}

.tenant-configuration-form > .page-section:first-child,
.tenant-configuration-form > .permission-locked-fields > .page-section:first-child,
.primary-card-page-header + .tenant-configuration-form > .permission-locked-fields > .page-section:first-child,
.external-identity-provider-show form > .permission-locked-fields > .page-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.permission-locked-fields {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.permission-locked-fields[aria-disabled="true"] :is(input, select, textarea, button) {
  cursor: not-allowed;
  opacity: .55;
}

/* Editable forms end with their action row; view-only forms need the same space before the next divider. */
.tenant-configuration-form > .permission-locked-fields[aria-disabled="true"],
.external-identity-provider-show form > .permission-locked-fields[aria-disabled="true"] {
  padding-bottom: 24px;
}

.tenant-identity-connection .form-grid + .form-grid { margin-top: 24px; }

.tenant-domains-actions {
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.tenant-domains-actions form {
  align-self: flex-end;
}

.tenant-domains-last-validation {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.primary-card-page-copy {
  min-width: 0;
}

.primary-card-page-title {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: 0;
}

.primary-card-page-description {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.primary-card-page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.primary-card-page-actions form {
  margin: 0;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(520px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(24px, 5vh, 42px) 0 0;
}

.app-shell-public .public-header .brand-mark img {
  width: 190px;
  max-height: 56px;
}

.app-shell-authed .topbar {
  display: none;
}

.app-shell-authed .content {
  min-width: 0;
  width: min(1320px, calc(100% - 44px));
  margin: 24px auto 44px;
  gap: 20px;
}

@media (min-width: 1440px) {
  .app-shell-authed .content.content-wide {
    width: min(1560px, calc(100% - 44px));
  }
}

.app-shell-public .content {
  width: min(520px, calc(100% - 36px));
  margin: clamp(20px, 5vh, 42px) auto clamp(28px, 6vh, 54px);
  justify-content: center;
  gap: 16px;
}

.app-shell-public .footer {
  text-align: center;
  background: transparent;
  border-top: 1px solid rgba(148, 163, 184, .11);
}

.app-shell-authed .footer {
  margin-top: auto;
  background: transparent;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

/* More premium content surfaces */
.card {
  background: linear-gradient(180deg, rgba(17, 27, 41, .92), rgba(10, 16, 26, .92));
  border-color: rgba(148, 163, 184, .16);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .22);
}

.card-body {
  padding: clamp(20px, 2.5vw, 30px);
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.page-header .title,
.h1 {
  font-size: clamp(25px, 2.5vw, 34px);
  letter-spacing: 0;
}

.page-header .subtitle {
  max-width: 760px;
  color: #a6b8cf;
}

.section-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.section-card-header-copy { min-width: 0; }

.section-card-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 19px;
  font-weight: 780;
  line-height: 1.25;
}

.section-card-description {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section-card-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.primary-card-section,
.primary-card-subsection {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

.primary-card-subsection {
  margin-top: 20px;
  padding-top: 20px;
}

.section-subsection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-subsection-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.35;
}

.page-list-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.microsoft-tenants-table {
  min-width: 800px;
}

.microsoft-tenants-table th:nth-child(3),
.microsoft-tenants-table td:nth-child(3) {
  white-space: nowrap;
}

.audit-log-table {
  min-width: 1040px;
  table-layout: fixed;
}

.audit-log-table th:first-child,
.audit-log-table td:first-child {
  width: 72px;
  white-space: nowrap;
}

.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(2) {
  width: 228px;
  white-space: nowrap;
}

.audit-log-table th:nth-last-child(2),
.audit-log-table td:nth-last-child(2) {
  width: 156px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.audit-log-table th:last-child,
.audit-log-table td:last-child {
  width: 82px;
  white-space: nowrap;
}

.audit-log-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-log-table td:nth-last-child(3),
.audit-log-table td:nth-last-child(4) {
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  white-space: normal;
}

.page-intro {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.page-intro .subtitle {
  max-width: 760px;
  color: #a6b8cf;
}

.page-section {
  padding: 24px 0;
}

.section-heading {
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
}

.toolbar, .table-toolbar {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.table-wrap {
  background: rgba(3, 7, 18, .22);
  border-color: rgba(148, 163, 184, .14);
}

.table thead th {
  background: rgba(255, 255, 255, .035);
}

.tile {
  min-height: 142px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .025));
  border-color: rgba(148, 163, 184, .14);
}

.tile-title {
  font-size: 16px;
}

.stat-card {
  min-height: 118px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .026));
  border-color: rgba(148, 163, 184, .14);
}

.stat-value {
  font-size: 34px;
}

.auth-card {
  position: relative;
  width: min(500px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 36px);
  border-color: rgba(47, 128, 255, .26);
  background:
    linear-gradient(180deg, rgba(22, 35, 52, .96), rgba(10, 16, 27, .98)),
    var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(47, 128, 255, .82), transparent);
}

.auth-card .form-heading {
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.auth-card .h1 {
  font-size: 32px;
}

.auth-card .muted {
  max-width: 420px;
  color: #a8b8cd;
  line-height: 1.5;
}

.auth-card .form {
  gap: 14px;
  margin-top: 18px;
}

.auth-remembered {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.auth-remembered-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-remembered-identity strong {
  overflow-wrap: anywhere;
}

.auth-remembered .auth-actions-secondary {
  margin-top: 0;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.auth-actions .btn-primary {
  flex: 1 1 auto;
}

.auth-actions-secondary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 2px;
}

.auth-actions-secondary .btn {
  width: 100%;
}

.auth-actions-secondary .muted,
.auth-secondary-form .muted {
  margin: 0;
  font-size: 13px;
}

.auth-secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, .12);
  color: var(--muted);
  font-size: 13px;
}

.auth-secondary-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

.auth-secondary-form .btn {
  width: 100%;
}

.auth-code-input {
  min-height: 50px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-invite-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.auth-invite-email {
  margin-top: 4px;
  color: var(--text-strong);
  font-weight: 760;
  overflow-wrap: anywhere;
}

@media (min-width: 1420px) {
  .brand-meta { display: flex; }
  .brand-mark img { width: 124px; }
}

@media (max-width: 760px) {
  .public-header {
    width: min(100% - 28px, 520px);
    padding-top: 22px;
  }

  .app-shell-public .content {
    width: min(100% - 28px, 520px);
    margin-top: 20px;
  }

  .auth-card {
    padding: 22px;
  }

  .auth-card .h1 {
    font-size: 28px;
  }

  .auth-actions,
  .auth-secondary-action,
  .auth-invite-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-actions .btn,
  .auth-actions a.btn {
    width: 100%;
  }

  .app-shell-authed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 31;
    width: min(320px, 88vw);
    height: 100dvh;
    padding: 16px;
    border-right: 1px solid rgba(148, 163, 184, .2);
    transform: translateX(-101%);
    transition: transform .22s ease, visibility 0s linear .22s;
    visibility: hidden;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    transition-delay: 0s;
    visibility: visible;
  }

  .sidebar-brand {
    padding-bottom: 12px;
  }

  .side-nav {
    display: block;
    overflow-y: auto;
    padding: 16px 0;
  }

  .side-nav-group {
    min-width: 0;
  }

  .side-nav-children {
    margin-left: 22px;
  }

  .side-nav-group + .side-nav-group {
    margin-top: 22px;
  }

  .sidebar-footer {
    display: block;
  }

  .sidebar-toggle,
  .sidebar-close {
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
    color: var(--text);
    cursor: pointer;
  }

  .sidebar-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
  }

  .sidebar-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .sidebar-close {
    display: inline-flex;
    margin-left: auto;
    font-size: 28px;
    line-height: 1;
  }

  .sidebar-toggle:hover,
  .sidebar-close:hover {
    border-color: rgba(47, 128, 255, .45);
    background: var(--primary-soft);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(2px);
    cursor: default;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

}

/* Keep the fixed utility controls separate from the flexible search region
   before the small-screen card layout takes over. */
@media (max-width: 960px) {
  .app-shell-authed .utility-bar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px 14px;
  }

  .app-shell-authed .utility-cluster {
    justify-content: flex-end;
    gap: 8px;
  }

  .app-shell-authed .utility-actions {
    gap: 2px;
  }

  .app-shell-authed .utility-organization-context {
    max-width: min(30vw, 160px);
  }

  .app-shell-authed .utility-search {
    width: 38px;
  }

  .app-shell-authed .utility-search input {
    width: 38px;
    padding-right: 0;
    padding-left: 36px;
    color: transparent;
    caret-color: transparent;
  }

  .app-shell-authed .utility-search input::placeholder {
    color: transparent;
  }

  .app-shell-authed .utility-action {
    width: 34px;
    height: 34px;
  }

  .app-shell-authed .utility-user-summary {
    display: none;
  }

  .app-shell-authed .utility-user-trigger {
    gap: 0;
    padding-right: 3px;
  }
}

@media (max-width: 390px) {
  .app-shell-authed .utility-bar {
    gap: 4px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .app-shell-authed .utility-organization-context {
    max-width: 88px;
  }
}

@media (max-width: 680px) {
  .app-shell-authed .content {
    width: min(100% - 28px, 760px);
    margin-top: 20px;
  }

  .utility-bar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px 14px;
  }

  .utility-actions {
    gap: 2px;
  }

  .utility-action {
    width: 34px;
    height: 34px;
  }

  .utility-user-summary {
    display: none;
  }

  .utility-user-menu summary,
  .utility-user-trigger {
    gap: 0;
    padding-right: 3px;
  }

  .primary-card-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-card-page-actions,
  .primary-card-page-actions .btn {
    width: 100%;
  }

}

/* Theme overrides must stay at the end so they win over page-specific surfaces. */
:root[data-theme="light"] body,
:root[data-theme="light"] .app-shell-authed {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .08), transparent 340px),
    linear-gradient(120deg, rgba(14, 165, 233, .08), transparent 420px),
    var(--bg);
}

:root[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(247, 250, 252, .96)),
    var(--surface);
  border-right-color: rgba(82, 97, 119, .2);
  box-shadow: 18px 0 50px rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .utility-bar,
:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, .86);
  border-bottom-color: rgba(82, 97, 119, .16);
}

:root[data-theme="light"] .card,
:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .error-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 250, 252, .98));
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

:root[data-theme="light"] .auth-card {
  border-color: rgba(37, 99, 235, .2);
}

:root[data-theme="light"] .auth-card .muted,
:root[data-theme="light"] .page-header .subtitle {
  color: var(--muted);
}

:root[data-theme="light"] .form-tile,
:root[data-theme="light"] .detail-panel,
:root[data-theme="light"] .toolbar,
:root[data-theme="light"] .table-toolbar,
:root[data-theme="light"] .admin-action-card,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .summary-card,
:root[data-theme="light"] .tile {
  background: rgba(255, 255, 255, .74);
  border-color: var(--border);
}

:root[data-theme="light"] .table-wrap,
:root[data-theme="light"] .credential-row {
  background: rgba(255, 255, 255, .62);
}

:root[data-theme="light"] .table thead th {
  background: rgba(241, 245, 249, .9);
}

:root[data-theme="light"] .table tbody tr:hover {
  background: rgba(37, 99, 235, .055);
}

:root[data-theme="light"] .profile-hero {
  background: linear-gradient(180deg, rgba(37, 99, 235, .09), rgba(255, 255, 255, .76));
}

:root[data-theme="light"] .input,
:root[data-theme="light"] .select,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--text);
}

:root[data-theme="light"] .input:focus,
:root[data-theme="light"] .select:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  background: #ffffff;
}

:root[data-theme="light"] .side-nav-link,
:root[data-theme="light"] .side-nav-sublink {
  color: #44546a;
}

:root[data-theme="light"] .side-nav-link:hover,
:root[data-theme="light"] .side-nav-sublink:hover {
  background: rgba(37, 99, 235, .07);
}

:root[data-theme="light"] .side-nav-link.is-active,
:root[data-theme="light"] .side-nav-sublink.is-active {
  color: #12305f;
  background: linear-gradient(90deg, rgba(37, 99, 235, .16), rgba(37, 99, 235, .05));
}

:root[data-theme="light"] .side-nav-icon {
  background: rgba(37, 99, 235, .07);
}

:root[data-theme="light"] .footer,
:root[data-theme="light"] .app-shell-authed .footer,
:root[data-theme="light"] .app-shell-public .footer {
  background: transparent;
  border-top-color: rgba(82, 97, 119, .16);
}

:root[data-theme="light"] .alert {
  color: var(--text);
}

:root[data-theme="light"] .alert-success {
  color: #065f46;
}

:root[data-theme="light"] .alert-info {
  color: #075985;
}

:root[data-theme="light"] .alert-warning {
  color: #7c4a03;
}

:root[data-theme="light"] .alert-danger {
  color: #991b1b;
}

:root[data-theme="light"] .btn-danger:not(:where(.row-action-menu .btn)) {
  border-color: rgba(153, 27, 27, .64);
  background: linear-gradient(180deg, #c24141, #991b1b);
  color: #ffffff;
}

:root[data-theme="light"] .btn-danger:hover:not(:where(.row-action-menu .btn)) {
  border-color: #7f1d1d;
  background: linear-gradient(180deg, #b73535, #7f1d1d);
  color: #ffffff;
}

:root[data-theme="light"] .cm-host {
  border-color: rgba(82, 97, 119, .26);
  background: #ffffff;
}

:root[data-theme="light"] .cm-editor {
  background-color: #ffffff;
  color: #172033;
}

:root[data-theme="light"] .cm-scroller {
  background-color: #ffffff;
}

:root[data-theme="light"] .cm-gutter,
:root[data-theme="light"] .cm-gutters {
  background: #f3f6fb;
  color: #64748b;
}

:root[data-theme="light"] .cm-gutters {
  border-right-color: rgba(82, 97, 119, .2);
}

:root[data-theme="light"] .cm-activeLine,
:root[data-theme="light"] .cm-activeLineGutter {
  background: rgba(37, 99, 235, .07);
}

:root[data-theme="light"] .cm-cursor {
  border-left-color: #0f172a !important;
}

:root[data-theme="light"] .cm-selectionBackground,
:root[data-theme="light"] .cm-editor.cm-focused .cm-selectionBackground {
  background: rgba(37, 99, 235, .18);
}

:root[data-theme="light"] .cm-matchingBracket,
:root[data-theme="light"] .cm-nonmatchingBracket {
  background: rgba(245, 158, 11, .18);
}

:root[data-theme="light"] .cm-invalidVar,
:root[data-theme="light"] .cmTok-invalid {
  color: #be123c;
  text-decoration-color: #e11d48;
}

:root[data-theme="light"] .cmTok-tag {
  color: #0369a1;
}

:root[data-theme="light"] .cmTok-attr {
  color: #b45309;
}

:root[data-theme="light"] .cmTok-string {
  color: #047857;
}

:root[data-theme="light"] .cmTok-comment {
  color: #6d28d9;
}

:root[data-theme="light"] .cm-ifBlock {
  background-color: rgba(245, 158, 11, .16);
}

:root[data-theme="light"] .cm-addonBlock {
  background-color: rgba(124, 58, 237, .13);
}
.totp-qr {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  image-rendering: pixelated;
}

.table-search-field {
  flex: 1 1 360px;
  max-width: 520px;
}

.table-toolbar-meta,
.table-pagination {
  white-space: nowrap;
}
.table-pagination-summary { margin-right: auto; color: var(--muted); font-size: 12px; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.login-domain-editor {
  display: grid;
  gap: 6px;
  width: min(100%, 380px);
}

.login-domain-list {
  display: grid;
  gap: 0;
}

.login-domain-row,
.login-domain-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.login-domain-row {
  min-height: 30px;
  padding: 2px 0 2px 8px;
  border-left: 2px solid rgba(148, 163, 184, .34);
}

.login-domain-row + .login-domain-row {
  border-top: 1px solid rgba(148, 163, 184, .16);
}

.login-domain-add-row {
  margin-top: 4px;
}

.login-domain-add-row .input {
  min-height: 34px;
}

.login-domain-text {
  min-width: 0;
  padding: 4px 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.login-domain-row.is-deleted {
  border-left-color: rgba(239, 68, 68, .45);
  opacity: .68;
}

.login-domain-row.is-deleted .login-domain-text {
  color: var(--muted);
  text-decoration: line-through;
}

.login-domain-remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.login-domain-remove img { display: block; width: 13px; height: 13px; }

.login-domain-remove:hover {
  border-color: rgba(240, 82, 82, .28);
  background: rgba(239, 68, 68, .12);
  color: #ff9b9b;
}
.login-domain-remove:hover img { filter: brightness(1.25); }
.login-domain-remove:focus-visible { outline: none; box-shadow: var(--focus); }

.login-domain-row.is-deleted .login-domain-remove {
  background: rgba(47, 128, 255, .08);
}
.login-domain-row.is-deleted .login-domain-remove img { display: block; width: 15px; height: 15px; }

.login-domain-row.is-deleted .login-domain-remove:hover {
  background: rgba(47, 128, 255, .16);
}

/* Focused consistency refinements for administration detail and management pages. */
:root[data-theme="light"] .table-controls-hump .table-controls-toolbar,
:root[data-theme="light"] .page-section > .form-grid > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]),
:root[data-theme="light"] .page-section > form > .form-grid > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]),
:root[data-theme="light"] .page-section > .section-heading + .form-tile:last-child:not(.danger-zone):not([class*="certificate-"]),
:root[data-theme="light"] .page-section > .form-tile:only-child:not(.danger-zone):not([class*="certificate-"]) {
  border-color: transparent;
  background: transparent;
}
:root[data-theme="light"] .login-domain-remove:hover {
  border-color: rgba(185, 28, 28, .3);
  background: rgba(185, 28, 28, .08);
  color: #b91c1c;
}
.authentication-local-users { margin: 0; padding: 0; border: 0; }
.authentication-section-header { margin: 0 0 12px; padding: 0; border: 0; }
.authentication-table-toolbar { margin: 0 0 12px; padding: 0; border: 0; border-radius: 0; background: transparent; }

.external-provider-usage {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: -8px 0 22px;
  color: var(--text);
  font-size: 13px;
}
.external-provider-usage-label { color: var(--muted); }
.external-provider-usage strong { color: var(--text-strong); font-weight: 720; }

.organization-log-collection-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.organization-log-collection-summary .detail-list { flex: 1 1 auto; }
.organization-logging-collection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, .12);
}
.organization-owner-invitation-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  font-size: 13px;
}
.organization-owner-invitation-complete strong,
.organization-owner-invitation-complete span { display: block; }
.organization-owner-invitation-complete strong { color: var(--text-strong); }
.organization-owner-invitation-complete > .muted { white-space: nowrap; }

.experimental-notice { color: var(--danger-strong); font-size: 13px; font-weight: 760; white-space: nowrap; }

.template-table-toolbar { margin: 0 0 12px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.template-table-toolbar input.input[type="search"] { flex: 1 1 260px; width: min(340px, 34vw); min-width: 220px; }
.assignment-table-toolbar,
.attribute-table-toolbar { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.assignment-table-container > .assignment-table-toolbar { margin-bottom: 12px; }
.role-permissions-actions, .role-permissions-page-size { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-permissions-actions { justify-content: flex-end; }
.role-permissions-page-size { margin: 0; }
.role-permissions-page-size .select { width: auto; min-width: 102px; }
.assignment-scope-actions,
.attribute-scope-actions { justify-content: flex-end; }

@media (max-width: 720px) {
  .table-toolbar,
  .table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .table-search-field {
    max-width: none;
  }

  .login-domain-row,
  .login-domain-add-row {
    grid-template-columns: 1fr;
  }

  .organization-log-collection-summary,
  .organization-owner-invitation-complete {
    align-items: stretch;
    flex-direction: column;
  }

  .template-table-toolbar input.input[type="search"],
  .role-permissions-page-size .select { width: 100%; max-width: none; }
}

@media (max-width: 680px) {
  .preview-panel-header { align-items: stretch; flex-direction: column; }
  .preview-panel-controls { align-items: stretch; flex-direction: column; }
  .preview-panel-control { justify-content: space-between; }
  .preview-attribute-table { min-width: 560px; }
  .template-conditional-grid { grid-template-columns: 1fr; }
}

/* Organization-scoped embedded image library */
.image-library-panel {
  position: relative;
  width: min(1120px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.image-library-panel .modal-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.image-library-modal-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .6rem;
}

.image-library-page-card {
  position: relative;
}

.image-library-page-card .card-body {
  min-width: 0;
}

.image-library-page {
  min-width: 0;
}

.image-library-page-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  min-height: clamp(520px, 66vh, 760px);
}

.image-library-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-height: none;
  padding: .25rem .4rem .4rem .15rem;
}

.image-library-page-details {
  padding-right: .25rem;
}

.image-library-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 520px);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.image-library-toolbar-search-only {
  grid-template-columns: minmax(240px, 520px);
}

.image-library-file-button {
  cursor: pointer;
  white-space: nowrap;
}

.image-library-upload-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
}

.image-library-upload-requirements {
  max-width: 250px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

[data-image-library-drop-surface].is-uploading {
  cursor: progress;
}

[data-image-library-drop-surface].is-dragging::after {
  content: "Drop images to upload";
  position: absolute;
  inset: .5rem;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 90%, var(--primary-soft));
  box-shadow: var(--focus);
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 760;
  pointer-events: none;
}

.image-library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  min-height: clamp(300px, 44vh, 400px);
}

.image-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  align-content: start;
  max-height: 620px;
  overflow: auto;
  padding: .15rem;
}

.image-library-card {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  color: inherit;
  padding: .6rem;
  text-align: left;
  display: grid;
  grid-template-rows: auto 2.5em auto 1.2em;
  gap: .35rem;
  cursor: pointer;
}

.image-library-card:hover,
.image-library-card:focus-visible,
.image-library-card.is-selected {
  border-color: var(--primary, #356ad8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #356ad8) 22%, transparent);
}

.image-library-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: repeating-conic-gradient(#ddd 0 25%, #f5f5f5 0 50%) 50% / 16px 16px;
}

.image-library-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-library-card-name {
  display: -webkit-box;
  height: 2.5em;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: anywhere;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-library-card > .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-library-card-usage {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 1.2em;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.image-library-card-usage span {
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: var(--primary-strong);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.image-library-details {
  border-left: 1px solid var(--border);
  padding-left: 1rem;
  min-width: 0;
}

.image-library-empty {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 100%;
  padding: 2rem;
  text-align: center;
}

.image-library-grid > .image-library-empty {
  grid-column: 1 / -1;
}

.image-library-grid.is-empty {
  align-content: stretch;
}

.image-library-preview {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: repeating-conic-gradient(#ddd 0 25%, #f5f5f5 0 50%) 50% / 16px 16px;
}

.image-library-details h3 {
  margin: .75rem 0 .45rem;
  overflow-wrap: anywhere;
}

.image-library-metadata .detail-row {
  grid-template-columns: 7.25rem minmax(0, 1fr);
}

.image-insert-properties,
.image-library-management {
  display: grid;
  gap: .65rem;
  margin-top: 1rem;
}

.image-default-alt-control,
.image-library-name-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.image-library-name-field {
  margin-top: .75rem;
  margin-bottom: 1rem;
}

.image-insert-html {
  min-height: 74px;
  resize: none;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  font-size: 12px;
  line-height: 1.45;
}

.image-library-management {
  grid-template-columns: 1fr 1fr;
}

.image-library-management .btn {
  justify-content: center;
}

.image-library-usage {
  margin-top: 1rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface-2);
}

.image-library-usage summary {
  cursor: pointer;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.image-library-usage[open] .image-library-usage-list {
  margin-top: .55rem;
}

.image-library-usage-list {
  max-height: 240px;
  overflow: auto;
  padding-right: .25rem;
}

.image-library-usage-group {
  padding: .45rem .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.image-library-usage-group + .image-library-usage-group {
  margin-top: .45rem;
}

.image-library-usage-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.image-library-usage-group-header span {
  display: inline-grid;
  min-width: 1.45rem;
  min-height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 800;
}

.image-library-usage-list ul,
.image-library-usage-group ul {
  display: grid;
  gap: .4rem;
  margin: .4rem 0 0;
  padding-left: 1.2rem;
}

.image-library-usage-list li span,
.image-library-usage-group li span {
  display: block;
  margin-top: .05rem;
  color: var(--muted);
  font-size: 11px;
}

img[data-sigora-image-missing="true"] {
  display: inline-block;
  min-width: 120px;
  min-height: 40px;
  border: 1px dashed #b94a48;
}

@media (max-width: 860px) {
  .image-library-toolbar,
  .image-library-layout {
    grid-template-columns: 1fr;
  }

  .image-library-details {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 1rem 0 0;
  }
}

@media (max-width: 560px) {
  .image-library-modal-actions,
  .image-library-management,
  .image-default-alt-control,
  .image-library-name-control {
    grid-template-columns: 1fr;
  }

  .image-library-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .image-library-upload-action {
    align-items: stretch;
  }

  .image-library-upload-requirements {
    max-width: none;
    text-align: left;
  }
}

/* License page */
.license-page .license-summary {
  border-top: 0;
  padding-top: 0;
}

.license-page .alert-msg-wrap {
  overflow-wrap: anywhere;
}

.license-alert-details {
  margin-top: 8px;
}

.license-alert-details summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 720;
}

.license-alert-details[open] > div {
  margin-top: 8px;
  white-space: pre-wrap;
}

.license-time {
  white-space: nowrap;
}

@media (min-width: 981px) {
  .license-summary-standalone > .summary-card {
    grid-column: span 4;
  }
}

.settings-fields .field > .table-status { justify-self: start; }
.template-draft-save-actions { margin-top: 16px; }

.settings-group-title { margin-top: 24px; }
.table-status { font-size: 13px; }
.table-status.compact { font-size: 12px; }
