:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --text: #182230;
  --muted: #667085;
  --border: #d9e0e8;
  --primary: #175cd3;
  --primary-dark: #124ba8;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); }
.topbar { min-height: 60px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); background: #101828; color: white; display: flex; align-items: center; gap: 22px; }
.brand { color: white; text-decoration: none; font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.main-nav .nav-icon { color: #d0d5dd; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 10px; text-decoration: none; border: 1px solid transparent; border-radius: 8px; font-size: .75rem; line-height: 1; white-space: nowrap; }
.main-nav .nav-icon svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; }
.main-nav .nav-icon:hover { color: white; background: #1d2939; border-color: #344054; }
.main-nav .nav-icon.active { color: white; background: #175cd3; border-color: #528bdf; }
.session { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: .9rem; }
.session small { color: #98a2b3; display: block; font-size: .7rem; }
.session form { margin: 0; }
.link-button { border: 0; background: none; color: #d1e0ff; padding: 0; cursor: pointer; }
.container { max-width: 1280px; margin: 0 auto; padding: 36px 24px 60px; }
h1, h2 { margin-top: 0; }
h1 { font-size: 1.75rem; margin-bottom: 8px; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.login-card { width: min(440px, 100%); margin: 8vh auto 0; }
.oidc-login { display: block; margin: 22px 0 16px; padding: 12px 16px; border-radius: 7px; text-align: center; text-decoration: none; font-weight: 700; }
.local-login-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.local-login-details summary { cursor: pointer; color: var(--muted); margin-bottom: 14px; }
.stack { display: grid; gap: 16px; }
label { color: #344054; font-size: .875rem; font-weight: 600; display: grid; gap: 6px; }
input, select, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 7px; padding: 10px 11px; background: white; color: var(--text); font: inherit; }
textarea { resize: vertical; font-family: ui-monospace, monospace; font-size: .78rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid #d1e9ff; border-color: #1570ef; }
input:disabled, select:disabled, textarea:disabled { background: #f8fafc; color: var(--muted); cursor: not-allowed; }
button { border-radius: 7px; padding: 10px 16px; border: 1px solid transparent; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: white; color: #344054; border-color: #b8c2cf; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 7px; padding: 10px 16px; border: 1px solid #b8c2cf; font-weight: 700; text-decoration: none; }
.danger { background: white; color: var(--danger); border-color: #f3b9b4; }
.error, .warning, .notice { padding: 12px 14px; border-radius: 8px; margin: 16px 0; }
.error { background: #fef3f2; color: #b42318; }
.warning { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.notice { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 24px; }
.count { background: #e8f1ff; color: #175cd3; border-radius: 999px; padding: 7px 12px; font-weight: 700; white-space: nowrap; }
.section-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -4px 0 22px; }
.section-menu-item { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); text-align: left; text-decoration: none; font: inherit; font-size: .86rem; font-weight: 700; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.section-menu-item svg { display: block; flex: 0 0 19px; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--primary); }
.section-menu-item:hover { border-color: #b2ccff; background: #f8fbff; }
.section-menu-item.active { border-color: #b2ddff; background: #eff8ff; color: #175cd3; }
.section-menu-item.active .menu-count { background: #d1e9ff; color: #175cd3; }
.section-menu-item.no-entry svg { color: var(--danger); stroke: none; }
.section-menu-item.no-entry svg circle { fill: currentColor; stroke: currentColor; }
.section-menu-item.no-entry svg path { fill: none; stroke: white; stroke-width: 3; stroke-linecap: round; }
.section-menu-item.no-entry.active { border-color: #fecdca; background: #fef3f2; color: var(--danger); }
.section-menu-item.no-entry.active .menu-count { background: #fee4e2; color: var(--danger); }
.menu-count { margin-left: auto; min-width: 26px; padding: 4px 7px; border-radius: 999px; background: #eef2f6; color: #475467; font-size: .72rem; line-height: 1; text-align: center; }
.section-anchor { scroll-margin-top: 84px; }
.association-section[hidden] { display: none; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: start; }
.main-column { display: grid; gap: 18px; }
.request-header { display: flex; justify-content: space-between; gap: 16px; }
.request-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 700; }
.uuid, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.uuid { font-size: 1.15rem; margin: 6px 0 0; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 3px 9px 4px; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1; background: #eef2f6; }
.badge.pending,
.badge.pending_user,
.badge.pending_admin,
.badge.challenge_pending { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.badge.approved { background: #f4f3ff; color: #5925dc; border: 1px solid #d9d6fe; }
.badge.issued,
.badge.delivered { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.badge.applied,
.badge.active { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.badge.reinstall { background: #f4f3ff; color: #5925dc; border: 1px solid #d9d6fe; }
.badge.rejected,
.badge.revoked,
.badge.expired { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.badge.blocked { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.badge.disabled { background: #f2f4f7; color: #475467; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 18px 0; margin: 18px 0; border-block: 1px solid #edf0f4; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .75rem; }
.facts dd { margin: 4px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.actions { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.approval-form { display: grid; grid-template-columns: 1.2fr 1fr 140px 155px auto; gap: 12px; align-items: end; flex: 1; }
.input-suffix { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.input-suffix input { width: 80px; }
.broker-card { position: sticky; top: 20px; }
.broker-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.broker-edit-toggle { color: var(--muted); font-size: .82rem; font-weight: 700; }
.management-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 110px 1.4fr; gap: 12px; }
.user-form-grid { grid-template-columns: 1fr 180px 160px minmax(360px, 1.6fr); align-items: end; }
.user-create-grid { grid-template-columns: 1fr 1fr 1.4fr 1.4fr; }
.password-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.user-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.broker-action-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; margin-top: 16px; }
.broker-left-actions { display: flex; align-items: center; gap: 10px; justify-self: start; }
.broker-left-actions form { margin: 0; }
.broker-action-row > .primary { justify-self: end; }
.broker-action-row > button:not(.danger):not(.primary) { justify-self: end; }
.broker-diagnostic, .broker-test-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid #edf0f4; }
.diagnostic-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.diagnostic-grid { display: grid; grid-template-columns: 1.1fr .9fr .6fr minmax(220px, 1.8fr); gap: 12px; margin: 0; }
.diagnostic-grid div { min-width: 0; }
.diagnostic-grid dt { color: var(--muted); font-size: .75rem; }
.diagnostic-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .86rem; }
.compact-diagnostic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.compact-warning { margin: 12px 0 0; }
.broker-test-result { border-radius: 8px; padding: 14px; border: 1px solid var(--border); background: #f8fafc; }
.broker-test-result h3 { margin: 0 0 10px; font-size: .98rem; }
.broker-test-result.success { background: #ecfdf3; border-color: #abefc6; }
.broker-test-result.failure { background: #fef3f2; border-color: #fecdca; }
.broker-test-checks { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.broker-test-checks li { display: flex; align-items: flex-start; gap: 9px; min-width: 0; overflow-wrap: anywhere; }
.check-badge { flex: 0 0 auto; min-width: 72px; padding: 3px 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; text-align: center; background: #eef2f6; color: #475467; }
.check-ok .check-badge { background: #d1fadf; color: #027a48; }
.check-warning .check-badge { background: #fef0c7; color: #93370d; }
.check-error .check-badge { background: #fee4e2; color: #b42318; }
.check-skipped .check-badge { background: #eef2f6; color: #475467; }
.filter-form { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(220px, 1.2fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; }
.recent-filter-form { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #edf0f4; }
.filter-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.confirm-dialog { border: 1px solid var(--border); border-radius: 12px; padding: 22px; max-width: 430px; box-shadow: 0 20px 40px rgba(16,24,40,.24); }
.confirm-dialog::backdrop { background: rgba(16,24,40,.45); }
.confirm-dialog h3 { margin: 0 0 8px; }
.create-card { margin-bottom: 30px; border-color: #b2ccff; box-shadow: 0 4px 12px rgba(23,92,211,.08); }
.section-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.section-heading h2 { margin: 5px 0 0; }
.existing-section > h2 { margin-bottom: 16px; }
.button-row { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.button-row form { margin: 0; }
.destructive-row { border-top: 1px solid #edf0f4; margin-top: 20px; padding-top: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; min-height: 42px; }
.checkbox-label input[type="checkbox"] { width: auto; }
.user-header { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(140px, .8fr) minmax(170px, .9fr) auto; align-items: center; column-gap: 28px; row-gap: 12px; }
.user-identity-block h2 { margin: 5px 0 0; overflow-wrap: anywhere; }
.user-meta-block strong { display: block; margin-top: 5px; font-size: .9rem; white-space: nowrap; }
.user-edit-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid #edf0f4; }
.compact-empty { padding: 24px 10px 4px; }
.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); }
.history { margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #edf0f4; }
th { color: var(--muted); font-size: .75rem; }
.sortable-heading { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sort-button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid transparent; border-radius: 999px; color: #98a2b3; text-decoration: none; }
.sort-button:hover { border-color: #b2ccff; background: #eff8ff; color: var(--primary); }
.sort-button.active { border-color: #b2ccff; background: #eff8ff; color: var(--primary); }
.sort-triangle { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort-triangle.asc, .sort-triangle.neutral { border-bottom: 6px solid currentColor; }
.sort-triangle.desc { border-top: 6px solid currentColor; }
.product-code-cell { min-width: 132px; white-space: nowrap; }
.inventory-hardware-cell { min-width: 150px; }
.inventory-hardware-content { display: inline-flex; align-items: center; gap: 8px; }
.inventory-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #b8c2cf;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.inventory-toggle:hover { border-color: #b2ccff; background: #eff8ff; }
.inventory-toggle[aria-expanded="true"] { background: #eff8ff; border-color: #b2ccff; }
.inventory-actions { min-width: 120px; vertical-align: top; }
.inventory-action-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.inventory-main-row.is-expanded td { border-bottom-color: transparent; background: #fcfdff; }
.inventory-detail-row td { border-bottom-color: #d9e0e8; }
.inventory-detail-cell { padding: 0 10px 14px; background: #fcfdff; }
.inventory-detail-panel {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}
.inventory-detail-section + .inventory-detail-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.inventory-detail-section h3 { margin: 0 0 10px; font-size: .82rem; color: #344054; }
.inventory-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 10px 14px; margin: 0; }
.inventory-detail-grid div { min-width: 0; }
.inventory-detail-grid dt { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.inventory-detail-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.certificate-revocation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.certificate-revocation-actions form { margin: 0; }
.long-value { word-break: break-all; }
.block-action-table td:first-child { min-width: 180px; }
.block-action-table td:last-child { min-width: 126px; }
@media (max-width: 1000px) {
  .grid, .management-grid { grid-template-columns: 1fr; }
  .broker-card { position: static; }
  .approval-form, .form-grid, .user-form-grid, .user-create-grid, .filter-form { grid-template-columns: 1fr 1fr; }
  .password-pair { grid-template-columns: 1fr 1fr; }
  .user-header { grid-template-columns: 1fr 1fr; }
  .section-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; padding-block: 14px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .main-nav .nav-icon { min-width: 42px; padding: 8px; }
  .main-nav .nav-icon span { display: none; }
  .container { padding-inline: 14px; }
  .section-menu { grid-template-columns: 1fr; }
  .section-menu-item { min-height: 46px; }
  .facts, .approval-form, .form-grid, .user-form-grid, .user-create-grid, .password-pair, .filter-form { grid-template-columns: 1fr; }
  .broker-action-row { grid-template-columns: 1fr; }
  .broker-left-actions { justify-self: stretch; flex-direction: column; }
  .broker-left-actions form, .broker-left-actions button, .broker-action-row > .primary, .broker-action-row > button:not(.danger):not(.primary) { justify-self: stretch; width: 100%; }
  .diagnostic-grid, .compact-diagnostic-grid { grid-template-columns: 1fr; }
  .inventory-detail-grid { grid-template-columns: 1fr; }
  .user-header { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions form, .actions button { width: 100%; }
}
