/* PQCTrust CA administration portal.
 *
 * A calm, high-contrast console in the family of modern trust-platform consoles: a deep indigo header with a floating
 * pill navigation, white rounded cards on a soft lavender canvas, and violet-to-indigo actions. Its own palette and
 * shapes - not a copy of any product.
 *
 * Everything is scoped to the portal (#app, the dialog and the drawer): the sign-in page is the standard ThrivoSign one
 * (thrivosign-login.css) and must not pick up anything from here.
 */

:root {
  --bg: #f3f2fa;
  --panel: #ffffff;
  --ink: #17143a;
  --ink-2: #3a3763;
  --muted: #6b6a8a;
  --line: #e3e1f1;
  --line-2: #cfcce6;
  --accent: #5b4ce6;
  --accent-2: #7a3ff0;
  --accent-deep: #3b2fb5;
  --accent-soft: #edeafe;
  --night: #0b2a55;
  --teal: #12b3a6;
  --ok: #0c8f62;
  --ok-soft: #e6f6ef;
  --warn: #9a5b00;
  --warn-soft: #fff4de;
  --bad: #c62a47;
  --bad-soft: #fdecef;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 20, 58, .05), 0 8px 28px rgba(35, 28, 95, .07);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

/*
 * The `hidden` attribute is how this page shows and hides panels, and a class that sets `display`
 * silently beats the UA stylesheet's `[hidden] { display: none }`. Several elements here are both
 * `hidden` and flex containers - the sign-in overlay, the modal, the top bar - so without this rule
 * they stay on screen forever. Marked !important because it has to win against any later class.
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 14px/1.55 "Inter", "Segoe UI Variable", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#app h1, #app h2, #app h3, #app h4, #modal h3, #cert-drawer h3 { margin: 0 0 .5rem; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
#app h2 { font-size: 1.45rem; }
#app h3 { font-size: 1.05rem; }

.muted { color: var(--muted); font-size: .86rem; }
.error { color: var(--bad); min-height: 1.2em; margin: .5rem 0 0; }
a { color: var(--accent); }

/* ---------------------------------------------------------------- sign in */
/* The sign-in page is the standard ThrivoSign one: thrivosign-login.css (do not restyle it here). */

/* ---------------------------------------------------------------- chrome */
.topbar {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .95rem 2rem 4.1rem;
  color: #fff;
  background:
    radial-gradient(900px 260px at 12% -40%, rgba(122, 63, 240, .45), transparent 70%),
    radial-gradient(700px 240px at 92% 10%, rgba(18, 179, 166, .22), transparent 70%),
    linear-gradient(135deg, #0b2a55 0%, #1b2b86 55%, #3b2fb5 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .9rem;
  min-width: 0;
}

.brand__logo { display: block; height: 32px; width: auto; max-width: none; flex: none; }

.brand__product {
  padding-left: .9rem;
  border-left: 1px solid rgba(255, 255, 255, .35);
  font-weight: 650;
  font-size: 1.1rem;
  letter-spacing: .01em;
}

.spacer { flex: 1; }
.topbar .muted { color: #d7d3f7; font-size: .9rem; }

.badge {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: .1rem .65rem;
  font-size: .74rem;
  letter-spacing: .02em;
}

.role-chips { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.role-chip {
  display: inline-block;
  padding: .08rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid #d9d4fb;
  margin: 0 .2rem .2rem 0;
}
.topbar .role-chip { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .22); margin: 0; }

.tabs {
  position: relative;
  display: flex;
  gap: .2rem;
  width: max-content;
  max-width: calc(100% - 3rem);
  margin: -2.35rem auto 0 2rem;
  padding: .35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(21, 16, 61, .18);
  /* Wraps instead of scrolling sideways (phase 3): eight entries, two of them menus. */
  z-index: 3;
}

#app .tab {
  background: none;
  box-shadow: none;
  border: none;
  border-radius: 999px;
  color: var(--ink-2);
  padding: .55rem 1.05rem;
  cursor: pointer;
  font: inherit;
  font-weight: 550;
  transition: background .15s, color .15s;
}

#app .tab:hover:not(.active) { background: var(--accent-soft); color: var(--accent-deep); filter: none; box-shadow: none; }
#app .tab.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 4px 12px rgba(91, 76, 230, .35); }
.tab .count { margin-left: .25rem; }

main { padding: 1.6rem 2rem 3rem; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-head h2, .section-head h3 { margin: 0; flex: 1; }

.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.1rem 2rem 0;
  padding: .7rem 1.1rem;
  background: var(--warn-soft);
  border: 1px solid #f1dba5;
  border-radius: var(--radius-sm);
  color: var(--warn);
}

.banner.bad { background: var(--bad-soft); border-color: #f4bcc6; color: var(--bad); }
.banner.ok { background: var(--ok-soft); border-color: #b6e3d0; color: var(--ok); }

/* ---------------------------------------------------------------- forms */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem;
}

#app label, #modal label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }

#app input, #app select, #app textarea, #modal input, #modal select, #modal textarea {
  width: 100%;
  margin-top: .25rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

#app input:focus, #app select:focus, #app textarea:focus, #modal input:focus, #modal select:focus, #modal textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 76, 230, .18);
}

#app fieldset, #modal fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 1rem 0 0; padding: .6rem .9rem .9rem; }
#app legend, #modal legend { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 .4rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
#app .checks label, #modal .checks label { display: flex; align-items: center; gap: .4rem; color: var(--ink); font-weight: 450; font-size: .88rem; }
#app .checks input, #modal .checks input { width: auto; margin: 0; }

.actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.1rem; }

#app button, #modal button, #cert-drawer button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .5rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(91, 76, 230, .28);
  transition: transform .1s, box-shadow .15s, filter .15s;
}

#app button:hover:not(:disabled), #modal button:hover:not(:disabled), #cert-drawer button:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 5px 16px rgba(91, 76, 230, .35); }
#app button:active:not(:disabled), #modal button:active:not(:disabled) { transform: translateY(1px); }

#app button.link, #modal button.link, #cert-drawer button.link {
  background: none;
  box-shadow: none;
  color: var(--accent);
  padding: .5rem .35rem;
  font-weight: 600;
}
#app button.link:hover:not(:disabled), #modal button.link:hover:not(:disabled), #cert-drawer button.link:hover:not(:disabled) { text-decoration: underline; filter: none; box-shadow: none; }

#app button.small, #modal button.small, #cert-drawer button.small { padding: .25rem .8rem; font-size: .8rem; box-shadow: none; }
#app button.small.link, #modal button.small.link { padding: .25rem .4rem; }
#app button:disabled, #modal button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
#app button.danger, #modal button.danger { background: linear-gradient(135deg, #d1344f, #a81f3a); box-shadow: 0 3px 10px rgba(198, 42, 71, .28); }
#app button.secondary, #modal button.secondary { background: #fff; color: var(--accent-deep); border: 1px solid var(--line-2); box-shadow: none; }
#app button.link.danger, #modal button.link.danger { background: none; color: var(--bad); box-shadow: none; }
#app .topbar button.link { color: #fff; text-decoration: none; opacity: .88; padding: .35rem .6rem; }
#app .topbar button.link:hover:not(:disabled) { opacity: 1; text-decoration: underline; }

.filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filter label { flex: 1 1 160px; }
.filter button { flex: 0 0 auto; }

/* ---------------------------------------------------------------- tables */
#app table, #modal table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#app th, #app td, #modal th, #modal td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
#app th {
  background: #f8f7fd;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
}
#app tbody tr { transition: background .12s; }
#app tbody tr:hover { background: #faf9ff; }
#app tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: var(--mono); font-size: .8rem; }
td .row-actions { display: flex; flex-wrap: wrap; gap: .35rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .02em;
  border: 1px solid;
}
.pill::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; }
.pill.ACTIVE, .pill.VALID, .pill.ISSUED, .pill.SUCCESS { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.pill.DRAFT, .pill.SUPERSEDED, .pill.INACTIVE, .pill.NOT_YET_VALID, .pill.PROCESSING, .pill.LOCKED { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.REVOKED, .pill.RETIRED, .pill.SUSPENDED, .pill.DISABLED, .pill.ON_HOLD, .pill.EXPIRED, .pill.FAILED, .pill.FAILURE, .pill.DENIED { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }

.keystore {
  display: inline-block;
  margin-top: .2rem;
  padding: 0 .5rem;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.keystore.HSM { background: #e3f7f4; color: #0b7c72; }
.keystore.SOFTWARE { background: #f1f0f8; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }

.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--accent), var(--teal)); }
.tile .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.tile .label { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* ---------------------------------------------------------------- modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 16, 61, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--panel);
  border-radius: 20px;
  width: min(820px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(21, 16, 61, .45);
}

.modal-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); background: #faf9ff; }
.modal-head h3 { flex: 1; margin: 0; }

.modal-card pre, pre.pem {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

#app textarea, #modal textarea { resize: vertical; font-family: var(--mono); }
.secret-box { background: var(--warn-soft); border: 1px solid #f1dba5; border-radius: var(--radius-sm); padding: .6rem .8rem; margin-bottom: .8rem; }

/* ------------------------------------------------------- portal additions */
:focus-visible { outline: 2px solid #7a63ff; outline-offset: 2px; }

.loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100;
  background: linear-gradient(90deg, transparent, #8b6bff, #12b3a6, transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: loading 1s linear infinite;
}
@keyframes loading { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.notice { color: var(--warn); min-height: 1.2em; margin: .5rem 0 0; }
.count { display: inline-block; min-width: 1.35em; padding: 0 .4em; border-radius: 999px; background: var(--bad);
  color: #fff; font-size: .7rem; font-weight: 700; text-align: center; }
.pad { padding: 0 1.3rem; }
.modal-body { padding: 1.2rem 1.3rem; overflow: auto; }
.modal-card .actions.pad { padding-bottom: 1.2rem; margin-top: .25rem; }
.modal-head { flex: 0 0 auto; }

#app h4 { margin: 1.2rem 0 .45rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
h3 + .tiles, .warnings + h3 { margin-top: 0; }
.view > h3 { margin-top: 1.5rem; }
.table-wrap { overflow-x: auto; margin-bottom: 1.1rem; padding-bottom: .2rem; }
/* Lists use the whole width and shrink to fit it: long values (serials, DNs, ids) wrap, so the action column stays on screen at
   every width. At 720 px and below each row becomes a card (labels from data-label, set by admin.js). */
.table-wrap th, .table-wrap td { overflow-wrap: anywhere; }
/* ...but headers, status pills, buttons, type tags and dates never break inside a word: a column is never squeezed below them. */
.table-wrap th, .table-wrap .pill, .table-wrap button, .table-wrap .tag, .table-wrap .keep { overflow-wrap: normal; }
.table-wrap .pill, .table-wrap button, .table-wrap .tag { white-space: nowrap; }
@media (max-width: 1100px) { .table-wrap .nowrap { white-space: normal; } }
/* A long identifier on one line, cut with an ellipsis; the full value is in its title and in Details, and search still sees it. */
.table-wrap .truncate { display: block; max-width: 20ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Short identifiers (CA, profile, grant ids) in mono that wrap only at hyphens, slashes and commas, never inside a word. */
.table-wrap .ids { font-family: var(--mono); font-size: .8rem; overflow-wrap: break-word; }
/* API clients: the client id is never broken across lines; the grants column stays narrow (a long list opens in a dialog) */
.table-wrap td.client-cell { min-width: 19rem; }
.table-wrap td.client-cell .client-id { white-space: nowrap; overflow-wrap: normal; }
.table-wrap td.grants-cell { width: 11rem; max-width: 11rem; }
#modal .grant-list { margin: .4rem 0 0; padding-left: 1.2rem; max-height: 50vh; overflow: auto; }
#modal .grant-list li { margin: .2rem 0; overflow-wrap: anywhere; }
.table-wrap .sub.ids { font-size: .76rem; }
/* Distinguished names have no spaces between their parts: they may break anywhere rather than widen the column. */
.table-wrap .dn { overflow-wrap: anywhere; }
/* Column priority: the row's name never gets squeezed; secondary detail (shown again in Details) gives way first. */
.table-wrap td.name-cell { min-width: 13rem; }
@media (max-width: 1280px) { .table-wrap .wide-only { display: none; } }
@media (min-width: 721px) and (max-width: 1100px) {
  .table-wrap .mid-hide { display: none; }
  #app .table-wrap th, #app .table-wrap td { padding: .6rem .6rem; }
}
.table-wrap .keep { white-space: nowrap; }
@media (max-width: 720px) { .table-wrap td.name-cell { min-width: 0; } }
.table-wrap .tag { display: inline-block; font-size: .78rem; font-weight: 650; letter-spacing: .03em; color: var(--ink-2); }
.table-wrap .sub { display: block; margin-top: .2rem; font-size: .8rem; color: var(--muted); }
/* Row actions: the main action(s) and one "More actions" button; the rest is in a menu, so the column stays narrow. */
td .row-actions.compact { align-items: center; flex-wrap: nowrap; }
.table-wrap td .sub.nowrap, .table-wrap td .pill + .sub { white-space: nowrap; }
#app button.more-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 50%; box-shadow: none; }
#app button.more-btn:hover:not(:disabled), #app button.more-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-deep);
  border-color: var(--accent); filter: none; box-shadow: none; }
#app button.more-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-menu { position: fixed; z-index: 45; min-width: 12rem; max-width: 20rem; padding: .35rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(21, 16, 61, .22); }
.row-menu button { display: block; width: 100%; margin: 0; padding: .55rem .8rem; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: .88rem; font-weight: 550; color: var(--ink); text-align: left; white-space: nowrap; cursor: pointer; }
.row-menu button:hover, .row-menu button:focus-visible { background: var(--accent-soft); color: var(--accent-deep); outline: none; }
.row-menu button.danger { color: var(--bad); }
.row-menu button.danger:hover, .row-menu button.danger:focus-visible { background: var(--bad-soft); color: var(--bad); }
.row-menu hr { margin: .3rem .2rem; border: 0; border-top: 1px solid var(--line); }
.scope-list > summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--accent-deep); white-space: nowrap; }
.scope-list[open] > summary { margin-bottom: .35rem; }
.scope-list > div { max-width: 28rem; line-height: 1.5; }
ul.plain { list-style: none; padding: 0; margin: 0 0 .5rem; }
ul.plain li { margin: .2rem 0; word-break: break-all; }
.small-link { font-size: .8rem; }
.actions.wrap { flex-wrap: wrap; }
.check-line { margin: .9rem 0 0; }
#app .check-line label { display: flex; align-items: center; gap: .45rem; color: var(--ink); font-weight: 450; font-size: .88rem; }
#app .check-line input, #app .checks.stacked input, #modal .checks.stacked input, #modal .check-line input { width: auto; margin: 0; }
.checks.stacked { flex-direction: column; gap: .5rem; }
#modal .checks.stacked label, #app .checks.stacked label { display: block; }
#modal .checks.stacked input, #app .checks.stacked input { display: inline-block; margin: 0 .45rem 0 0; vertical-align: middle; }
.checks.stacked label small, .checks small { color: var(--muted); font-size: .78rem; margin-left: .25rem; font-weight: 400; }
.inline { display: flex; gap: .4rem; }
.inline input { flex: 1; min-width: 0; }
#app input[readonly], #app input:disabled, #app select:disabled, #app textarea:disabled,
#modal input[readonly], #modal input:disabled { background: #f4f3fa; color: var(--muted); }
.field-required > span::after { content: " *"; color: var(--bad); }
.field-forbidden { opacity: .6; }
.req { color: var(--bad); font-size: .75rem; margin-left: .25rem; }

.warnings { margin-bottom: 1.1rem; }
.warning {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  padding: .75rem 1rem; margin-bottom: .55rem;
  background: var(--warn-soft); border: 1px solid #f1dba5; border-left: 5px solid #e0a020; border-radius: var(--radius-sm); color: #5c3d00;
}
.warning.severe { background: var(--bad-soft); border-color: #f4bcc6; border-left-color: var(--bad); color: #6d1424; }
.warning.good { background: var(--ok-soft); border-color: #b6e3d0; border-left-color: var(--ok); color: #0b5f42; }
.warning .code { font-weight: 700; font-family: var(--mono); font-size: .8rem; }
.warning .msg { flex: 1 1 280px; }
.warning-card { display: block; }
.warning-card.critical, .warning-card.high { background: var(--bad-soft); border-color: #f4bcc6; border-left-color: var(--bad); color: #6d1424; }
.warning-card.good { background: var(--ok-soft); border-color: #b6e3d0; border-left-color: var(--ok); color: #0b5f42; }
.warning-heading { display: flex; align-items: center; gap: .4rem .8rem; flex-wrap: wrap; }
.warning-heading strong { font-size: 1rem; }
.warning-status, .warning-blocker { border: 1px solid currentColor; border-radius: 999px; padding: .12rem .45rem; font-size: .72rem; font-weight: 700; }
.warning-affected { margin-top: .35rem; font-size: .8rem; font-weight: 700; }
.warning-card p { margin: .45rem 0; }
.warning-details { margin-top: .6rem; font-size: .8rem; }
.warning-details summary { cursor: pointer; font-weight: 650; }
.warning-details code { display: inline-block; margin-top: .45rem; }
.warning-details p { overflow-wrap: anywhere; }
.approval-item { margin: 0 .45rem .55rem 0; text-align: left; }
.approval-detail { margin-top: .8rem; }
.approval-payload { margin: .5rem 0 1rem; padding: .85rem; max-height: 18rem; overflow: auto;
  background: #f5f4fa; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .78rem; }
.warnings .allclear { padding: .7rem 1rem; background: var(--ok-soft); border: 1px solid #b6e3d0; border-radius: var(--radius-sm); color: var(--ok); }
.tile.link-tile { cursor: pointer; transition: transform .12s, box-shadow .15s; }
.tile.link-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(35, 28, 95, .14); }
.tile .value.sm { font-size: 1.15rem; overflow-wrap: anywhere; }

.pager { display: flex; align-items: center; gap: .6rem; margin: 0 0 1rem; flex-wrap: wrap; }
.pager .info { color: var(--muted); font-size: .85rem; }

dl.facts { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: .35rem .9rem; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .82rem; }
dl.facts dd { margin: 0; word-break: break-all; }
dl.facts dd.mono { font-family: var(--mono); font-size: .8rem; }

.rules-table td, .rules-table th { padding: .35rem .6rem; }
.rules-table select { width: auto; min-width: 9rem; }
.rules-table td:first-child { white-space: nowrap; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); z-index: 20;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(21, 16, 61, .28);
  display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: #faf9ff; }
.drawer-head h3 { flex: 1; margin: 0; word-break: break-all; }
.drawer-body { padding: 1.1rem 1.2rem; overflow: auto; flex: 1; }
.drawer-body section { margin-bottom: 1.25rem; }
.modal { z-index: 50; }

.mfa-qr { display: block; width: 200px; height: 200px; margin: .5rem auto; background: #fff; padding: 6px; border-radius: 6px; }
.mfa-codes { width: 100%; font-family: var(--mono); font-size: .95rem; line-height: 1.5; }
.secret-row { display: flex; gap: .4rem; align-items: center; margin: .35rem 0; }
.secret-row label { flex: 0 0 110px; margin: 0; }
.secret-row input { flex: 1; font-family: var(--mono); margin-top: 0; }
.onetime { background: var(--bad-soft); border: 1px solid #f4bcc6; color: #6d1424; border-radius: var(--radius-sm); padding: .65rem .85rem; margin: .75rem 0; }
.result { margin-top: 1rem; padding: .9rem; border: 1px solid #b6e3d0; background: #f3fbf7; border-radius: var(--radius-sm); }
.result.bad { border-color: #f4bcc6; background: #fef5f6; }
.grant-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; margin-bottom: .4rem; align-items: center; }
.grant-row .grant-warn { grid-column: 1 / -1; margin: -.15rem 0 .2rem; color: var(--warn); font-size: .85rem; }
.grant-row .grant-warn:empty { display: none; }
.grant-row--invalid select { border-color: #e0a020; background: var(--warn-soft); }

/* TSA & OCSP tab: label / value rows inside a card */
dl.kv { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; gap: .4rem 1rem; margin: 0 0 .75rem; }
dl.kv dt { color: var(--muted); font-size: .84rem; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
#view-pki-services .row-actions, .card .row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Search box above each list */
.list-search { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0 0 .7rem; }
.list-search__dates { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
#app .list-search__dates label { display: inline; margin: 0; font-size: .9rem; color: #6b6a8a; white-space: nowrap; }
#app .list-search .list-search__dates input { width: auto; padding: .45rem .7rem; border-radius: 10px; }
#app .list-search .list-search__dates button[hidden] { display: none; }
.list-search__field { position: relative; flex: 0 1 440px; min-width: 0; }
#app .list-search input { width: 100%; margin-top: 0; border-radius: 999px; padding-left: 1rem; padding-right: 4.6rem; background: #fff; }
#app .list-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }   /* our clear button replaces it */
#app .list-search .list-search__go, #app .list-search .list-search__clear {
  position: absolute; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; color: #6b6a8a; background: transparent; border: 0; border-radius: 50%; box-shadow: none; filter: none;
}
#app .list-search .list-search__go { right: .35rem; }
#app .list-search .list-search__clear { right: 2.4rem; }
#app .list-search .list-search__clear[hidden] { display: none; }
#app .list-search .list-search__go:hover:not(:disabled), #app .list-search .list-search__clear:hover:not(:disabled) { color: var(--accent-deep); background: var(--accent-soft, #efecff); box-shadow: none; filter: none; }
#app .list-search .list-search__go:active:not(:disabled), #app .list-search .list-search__clear:active:not(:disabled) { transform: translateY(-50%); }
#app .list-search .list-search__go:focus-visible, #app .list-search .list-search__clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.list-search-count { white-space: nowrap; }
.list-search-empty { padding: .5rem 0; }

/* several TSAs: one card each; key storage; roles */
.section-head.sub { margin: 1.5rem 0 .6rem; }
.section-head.sub h3 { margin: 0; flex: 1; }
.card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: .6rem; }
.card-head h3, .card-head h4 { margin: 0; font-size: 1.02rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.hsm-card { border-top: 4px solid transparent; border-image: linear-gradient(90deg, var(--accent), var(--teal)) 1; border-image-slice: 1; }
#app .audit-table td:nth-child(3) { min-width: 11rem; }
/* Audit search panel: the advanced filters sit under the default row; the note says what the search will do. */
#app .audit-advanced { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
#app .audit-search-note { margin: .8rem 0 0; }
#app .audit-trace-head { margin: .4rem 0 .6rem; }
#app .audit-trace-head h3 { font-size: 1.02rem; word-break: break-all; }
#app .audit-trace-sources { margin: 1.2rem 0 .5rem; font-size: .95rem; }

@media (max-width: 720px) {
  main { padding: 1rem .8rem 2rem; }
  .topbar { flex-wrap: wrap; padding: .8rem 1rem 3.6rem; }
  .tabs { margin-left: .8rem; max-width: calc(100% - 1.6rem); }
  .banner { margin: .8rem .8rem 0; }
  .section-head { flex-wrap: wrap; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { margin-top: .4rem; }
  dl.kv { grid-template-columns: 1fr; }
  .grant-row { grid-template-columns: 1fr; }
  .modal { padding: .5rem; }
  .secret-row { flex-wrap: wrap; }
  .secret-row label { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .loading-bar { animation: none; } .view.active { animation: none; } }

/* HSM connections (key storage) and the key profile shown when a CA is created */
.key-profile { margin: 1rem 0 0; }
.key-profile .profile-box { border: 1px solid #dcd8f0; border-radius: 12px; padding: .8rem 1rem; background: #faf9ff; }
.key-profile .profile-box h4 { margin: 0 0 .5rem; font-size: .95rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.key-profile .profile-box.empty { border-style: dashed; }
.hsm-table td .tag { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: #efecfb; color: var(--muted); }
.hsm-table td .tag.default { background: #e3f7f4; color: #0b7c72; }
.hsm-warning { color: var(--bad); font-size: .82rem; margin: .2rem 0 0; }
#hsm-form .form-result { margin: .6rem 0 0; min-height: 1.4rem; }
#hsm-form .form-result.bad { color: var(--bad); }
.empty-hsm { margin: .4rem 0 .8rem; }

/* key verification */
.verify-item { border-top: 1px solid #e6e3f5; padding: .5rem 0; }
.verify-item h4 { margin: 0 0 .25rem; font-size: .92rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.verify-checks { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .84rem; }
.verify-checks .FAIL { color: var(--bad); }
.verify-checks .WARN { color: #9a6700; }
.verify-checks .PASS { color: var(--muted); }
.pill.CONNECTED { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.pill.DEGRADED, .pill.UNTESTED { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.UNUSABLE { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
.test-checks { margin: .3rem 0 0; padding: 0; list-style: none; font-size: .85rem; }
.test-checks li { margin: .1rem 0; }
.test-checks .bad { color: var(--bad); }
.diagnosis-box { margin: .4rem 0 0; }
.diagnosis-box summary { cursor: pointer; font-size: .86rem; }
.diagnosis { width: 100%; border-collapse: collapse; font-size: .82rem; margin: .3rem 0; }
.diagnosis th, .diagnosis td { text-align: left; vertical-align: top; padding: .25rem .4rem; border-bottom: 1px solid var(--line, #e3e3e3); }
.diagnosis .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .76rem; }
.step-status { display: inline-block; min-width: 4.2rem; text-align: center; border-radius: 999px; font-weight: 600; font-size: .74rem; padding: 0 .4rem; }
.step-status.PASS { background: #e3f6ea; color: #1b6b3a; }
.step-status.WARN { background: #fff4e0; color: #8a5300; }
.step-status.FAIL { background: #fde8e7; color: #b3261e; }
.step-status.SKIPPED { background: #eeedf5; color: #5b5876; }
.pill.OK, .pill.PASS { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.pill.WARNING, .pill.NOT_APPLICABLE { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.FAIL { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
.pill.WARN { color: #9a6700; border-color: #ecd9a8; background: #fff6dd; }

/* approval queue */
#approval-card table { margin-top: .5rem; }
#approval-card .muted.empty { margin: .4rem 0 0; }

/* ---- Trust services: sub-navigation, wizard, field-level errors, lifecycle pills ---- */
.subtabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0 1rem; border-bottom: 1px solid var(--line); }
.subtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: .45rem .7rem; color: var(--muted); cursor: pointer; font: inherit; }
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--ink); border-bottom-color: currentColor; font-weight: 600; }
.wizard-steps { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 .9rem; counter-reset: none; }
.wizard-steps li { padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; font-size: .84rem; color: var(--muted); }
.wizard-steps li.current { color: var(--ink); border-color: currentColor; font-weight: 600; }
.wizard-steps li.done { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.field-error { color: var(--bad); display: block; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--bad) !important; }
label.check { display: block; margin: .2rem 0; }
.pill.READY, .pill.UP, .pill.COMBINED, .pill.TSA_ONLY, .pill.OCSP_ONLY, .pill.VERIFIED, .pill.CERTIFICATE_RECEIVED { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.pill.CONFIGURING, .pill.VALIDATING, .pill.UNKNOWN, .pill.SKIPPED, .pill.PENDING, .pill.INFO { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.DOWN, .pill.CRITICAL { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
@media (max-width: 640px) { .wizard-steps li { font-size: .78rem; } }

/* Dashboard licence chip: one line of status; it opens System Administration > License (the full licence card). */
/* As a button it must still look like the status pill, not like the page's gradient action buttons (#app button). */
.license-headline { flex: 1; }

/* Certificate publication (CERT_PUBLISHER) */
.pill.CURRENT, .pill.SUCCEEDED, .pill.APPROVED { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.pill.BEHIND, .pill.RETRY, .pill.RUNNING, .pill.STALE, .pill.PENDING_APPROVAL, .pill.UNVALIDATED, .pill.NOT_CONFIGURED,
.pill.NOT_PROBEABLE, .pill.MISMATCH { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.UNREACHABLE, .pill.INVALID, .pill.REJECTED, .pill.CANCELLED { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
.pill.NONE { color: var(--muted, #667085); }
.pub-findings li { margin: 0.25rem 0; }
#pub-test-url { min-width: 22rem; max-width: 100%; }
@media (max-width: 640px) { #pub-test-url { min-width: 0; width: 100%; } }

/* ------------------------------------------------ navigation: wrapping list, menus, narrow-screen menu (phase 3) */
.nav-list { display: flex; flex-wrap: wrap; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.nav-list > li { position: relative; }
.nav-group__toggle::after { content: ""; display: inline-block; margin-left: .45rem; width: .4rem; height: .4rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.15rem) rotate(45deg); }
.nav-group__toggle[aria-expanded="true"]::after { transform: translateY(.05rem) rotate(-135deg); }
.nav-menu { position: absolute; top: calc(100% + .35rem); left: 0; min-width: 14rem; margin: 0; padding: .35rem; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(21, 16, 61, .22); z-index: 5; }
.nav-menu[hidden] { display: none !important; }
#app .nav-menu .tab { display: block; width: 100%; text-align: left; border-radius: 10px; }
#app .nav-menu .tab.danger-item { color: var(--bad); }
#app .nav-menu .tab.danger-item.active { color: #fff; background: var(--bad); }
.nav-toggle { display: none; }
#app .topbar .nav-toggle { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff; box-shadow: none;
  border-radius: 10px; padding: .35rem .8rem; font-weight: 600; }
.brand__logo { height: 32px; }
@media (max-width: 900px) {
  .brand__product { font-size: .98rem; }
  .nav-toggle { display: inline-block; }
  .topbar { flex-wrap: wrap; padding-bottom: .9rem; }
  .tabs { width: auto; max-width: none; margin: .5rem .8rem 0; border-radius: 16px; display: none; }
  .tabs.open { display: block; }
  .nav-list { flex-direction: column; }
  #app .tabs .tab { display: block; width: 100%; text-align: left; border-radius: 10px; }
  .nav-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 1rem; min-width: 0; }
}
@media (max-width: 520px) {
  .brand__logo { height: 26px; }
  .brand__product { padding-left: .6rem; font-size: .9rem; }
}

/* ------------------------------------------------ dashboard health line (phases 2, 5) */
.health-line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0 0 1rem; color: var(--ink-2); }
.health-line:empty { display: none; }
#app .health-line button.link { padding: 0; }
.warn-text { color: #8a5300; }
.license-warnings p { margin: .4rem 0; }

/* ------------------------------------------------ certificate profile sections (phase 7) */
.profile-form .profile-section { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.1rem 1rem; margin: 0 0 1rem; }
.profile-form .profile-section > legend { font-weight: 700; padding: 0 .4rem; }
.profile-form .profile-section.has-problem { border-color: var(--bad); border-width: 2px; }
.profile-form .section-hint { margin: 0 0 .7rem; }
.profile-form h4 { margin: .9rem 0 .4rem; font-size: .92rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.key-type-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem 1.2rem; }
.key-family { display: flex; flex-direction: column; gap: .25rem; }
.key-family__name { font-weight: 650; font-size: .85rem; color: var(--ink-2); }
.profile-problems { border: 1px solid var(--bad); border-radius: 12px; padding: .7rem 1rem; margin: 0 0 1rem; background: #fff5f5; }
.profile-problems ul { margin: .4rem 0 0; padding-left: 1.2rem; }
#app .profile-problems button.link { text-align: left; padding: 0; white-space: normal; }
.sticky-actions { position: sticky; bottom: 0; background: var(--panel); padding: .7rem 0; border-top: 1px solid var(--line); z-index: 1; }
.policy-note { max-width: 46rem; white-space: normal; }

/* ------------------------------------------------ system reset (phase 4) */
.danger-zone { border: 1px solid var(--bad); border-left-width: 6px; border-radius: 12px; padding: .8rem 1.1rem; margin: 0 0 1rem; background: #fff7f7; }
.danger-card { border-top: 4px solid var(--bad); }
.danger-card ul { margin: .2rem 0 .6rem; }

/* ------------------------------------------------ trust services: legacy blocks and request log (phases 9, 11) */
.trust-legacy { margin-top: 1.2rem; }
.request-log-filter .grid { margin-bottom: .6rem; }
/* Sub-section tabs (Trust Services): "#app button" gives every button the filled gradient, so the tab look needs this. */
#app button.subtab { background: none; box-shadow: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); padding: .45rem .7rem; font-weight: 550; }
#app button.subtab:hover { color: var(--ink); background: var(--accent-soft); filter: none; }
#app button.subtab.active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 650; }

/* List first (2026-10-30): every page opens on its list; a create / edit form (data-editor-for) replaces the list while it
   is open, under a Back link. Lists share one compact filter row, fold the rarer filters away and show a Created column. */
.editor-bar { margin: 0 0 .6rem; }
#app button.link.editor-back { padding: .2rem 0; font-weight: 600; }
.filter-card { padding-top: 1rem; padding-bottom: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.filter-row > label { flex: 1 1 150px; min-width: 0; }
.filter-row > label.grow { flex: 2 1 240px; }
.filter-buttons { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
#app .filter-card fieldset.status-checks { margin-top: .8rem; padding: .35rem .8rem .55rem; }
.more-filters { margin-top: .8rem; }
.more-filters > summary, details.fold > summary { cursor: pointer; font-weight: 600; color: var(--accent-deep); font-size: .9rem; }
.more-filters[open] > summary { margin-bottom: .7rem; }
details.fold > summary { font-size: 1rem; color: var(--ink); }
details.fold[open] > summary { margin-bottom: .8rem; }
.list-note { margin-top: .4rem; font-size: .86rem; }
#app .list-note button.link { padding: 0 .2rem; }
td.nowrap, .nowrap { white-space: nowrap; }
/* A list that must fit its panel: fixed column widths, long values wrap, so the action column is never off screen. */
.fit-table { table-layout: fixed; width: 100%; }
.fit-table th, .fit-table td { overflow-wrap: anywhere; }
@media (min-width: 721px) {
  .cert-table th:nth-child(1) { width: 12%; } .cert-table th:nth-child(2) { width: 30%; } .cert-table th:nth-child(3) { width: 17%; }
  .cert-table th:nth-child(4) { width: 15%; } .cert-table th:nth-child(5) { width: 9%; } .cert-table th:nth-child(6) { width: 10%; }
  .cert-table th:nth-child(7) { width: 7%; }
}
@media (max-width: 720px) {
  #app .table-wrap table, #app .table-wrap tbody, #app .table-wrap tr { display: block; width: auto; }
  #app .table-wrap table { table-layout: auto; border: none; background: none; box-shadow: none; overflow: visible; }
  #app .table-wrap thead { display: none; }
  #app .table-wrap tbody tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: .45rem .85rem; margin-bottom: .65rem; }
  #app .table-wrap td { display: grid; grid-template-columns: minmax(6rem, 32%) minmax(0, 1fr); column-gap: .75rem; align-items: start;
    padding: .35rem 0; border-bottom: 1px solid var(--line); }
  #app .table-wrap tr td:last-child { border-bottom: none; }
  #app .table-wrap td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 9; color: var(--muted); font-size: .72rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: .1rem; }
  #app .table-wrap td > * { grid-column: 2; }
  #app .table-wrap td > .pill, #app .table-wrap td > .tag, #app .table-wrap td > .keystore { justify-self: start; }
  #app .table-wrap td[data-label=""]::before { content: none; }
  #app .table-wrap td[data-label=""] { display: block; }
  /* Small fact / settings tables outside a list (Licensing, Change approvals): tighter cells, long words wrap. */
  #app th, #app td { padding: .5rem .55rem; overflow-wrap: anywhere; }
}
.bad-text { color: var(--bad); font-weight: 600; font-size: .85rem; }
#app .topbar #time-zone { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .filter-buttons { flex-basis: 100%; }
  td.nowrap { white-space: normal; }
}

/* Effective permissions (Users > Access, API clients > Access, My access) */
.access-facts { width: 100%; margin: .5rem 0; }
.access-facts th { text-align: left; width: 11rem; font-weight: 600; vertical-align: top; }
.access-ops { width: 100%; font-size: .85rem; }
.access-ops td.mono { word-break: break-all; }

/* An API client form refusal is shown next to its Save button (the page banner is out of view there) */
.form-error { margin: .4rem 0; padding: .55rem .8rem; border: 1px solid #f4bcc6; border-radius: 8px; background: var(--bad-soft);
  color: var(--bad); }
/* CA provisioning dialog (2026-11-03): choice lists in two columns */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .1rem 1rem; }

/* Certificate Publication: the everyday view first, the rest one click away. */
details.pub-advanced, details.pub-more { margin: 1rem 0; }
details.pub-advanced > summary, details.pub-more > summary { cursor: pointer; font-weight: 650; padding: .35rem 0; }
details.pub-more { margin: .6rem 0 0; }
details.pub-more > summary { font-size: .85rem; font-weight: 600; color: var(--muted, #667); }
.pub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem 1.2rem; margin: .4rem 0 .8rem; }
.pub-facts div { display: flex; flex-direction: column; }
.pub-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #667); }
.pub-facts dd { margin: 0; font-weight: 650; }

/* ------------------------------------------------ certificate profile templates (dashboard tiles as choices) */
.tiles.tpl-tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: .4rem; }
#app button.tile.tpl-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: 100%; margin: 0;
  text-align: left; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
#app button.tile.tpl-tile .value.sm { font-size: .98rem; letter-spacing: 0; }
#app button.tile.tpl-tile .label { line-height: 1.4; font-weight: 400; }
#app button.tile.tpl-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#app button.tile.tpl-tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
#app button.tile.tpl-tile { border-radius: var(--radius); padding: 1rem 1.1rem 1rem 1.25rem; font-weight: 400; }
#app button.tile.tpl-tile:hover:not(:disabled) { filter: none; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(35, 28, 95, .14); }
#app button.tile.tpl-tile[aria-pressed="true"]:hover { box-shadow: 0 0 0 1px var(--accent), 0 10px 30px rgba(35, 28, 95, .14); }

/* ------------------------------------------------ subject / SAN rules: fields in use, then fields to allow */
.rules-picker .rules-summary { margin: 0 0 .5rem; font-size: .85rem; }
.rules-picker .rules-used table { width: 100%; }
.rules-picker .rules-used td, .rules-picker .rules-used th { padding: .4rem .6rem; vertical-align: middle; }
.rules-picker .rules-used td:first-child { width: 55%; }
.rules-picker .rules-used td:first-child span { display: block; }
.rules-picker .rules-key { color: var(--muted); font-size: .76rem; }
.rules-picker .rules-used select { width: auto; min-width: 9rem; }
.rules-picker .rules-remove { text-align: right; width: 1%; white-space: nowrap; }
.rules-picker .rules-add { margin-top: .8rem; }
.rules-picker .rules-add-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .45rem 1.2rem; }

/* Profile F: "Allow all Issuing CAs" - one highlighted row: tick + text side by side (2026-11-17) */
#app .checks.profile-all-cas { margin: .6rem 0 .9rem; padding: .7rem .9rem; border: 1px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--accent-soft); }
#app .checks.profile-all-cas label { display: flex; align-items: flex-start; gap: .6rem; margin: 0; cursor: pointer;
  color: var(--ink); font-size: .9rem; line-height: 1.45; }
#app .checks.profile-all-cas input { flex: none; width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; accent-color: var(--accent); }
#app .checks.profile-all-cas strong { color: var(--accent-deep); }


/* Profile F: Issuing CA assignment - "Allow all" first, then a tidy CA picker (2026-11-17) */
#app .checks.profile-all-cas strong { display: block; font-size: .95rem; }
#app .profile-all-cas__hint { display: block; color: var(--ink-2); font-size: .86rem; margin-top: .1rem; }
#app #profile-mapped-note { margin: -.4rem 0 .8rem; }
#app .ca-pick[hidden] { display: none; }
#app .ca-pick__title { margin: .2rem 0 .5rem; font-weight: 600; color: var(--ink-2); font-size: .88rem; }
#app .ca-pick__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: 0 0 .7rem; }
#app .ca-pick__toolbar[hidden] { display: none; }
#app .ca-pick__toolbar input[type=search] { flex: 1 1 280px; margin: 0; }
#app .ca-pick__toggle { display: inline-flex; align-items: center; gap: .4rem; margin: 0; white-space: nowrap; font-size: .88rem;
  color: var(--ink); font-weight: 450; }
#app .ca-pick__toggle input { width: auto; margin: 0; }
#app .ca-pick__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .5rem; }
#app .ca-pick__item { display: flex; align-items: center; gap: .65rem; margin: 0; padding: .6rem .75rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font-weight: 450; }
#app .ca-pick__item[hidden] { display: none; }
#app .ca-pick__item:hover { border-color: var(--line-2); }
#app .ca-pick__item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
#app .ca-pick__item input { flex: none; width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); }
#app .ca-pick__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#app .ca-pick__name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app .ca-pick__id { font-family: var(--mono); font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
#app .ca-pick__status { flex: none; font-size: .7rem; font-weight: 600; letter-spacing: .03em; padding: .12rem .45rem;
  border-radius: 999px; background: var(--line); color: var(--ink-2); }
#app .ca-pick__status--active { background: var(--ok-soft); color: var(--ok); }
#app .ca-pick__status--suspended, #app .ca-pick__status--draft { background: var(--warn-soft); color: var(--warn); }
#app .ca-pick__status--retired { background: var(--bad-soft); color: var(--bad); }

/* CA list filters (PQCTrust 1.0): quick row + Advanced filters, read from the CA records */
.ca-filters { margin: -.2rem 0 .8rem; }
.ca-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .9rem; }
#app .ca-filters .filter-field { display: flex; flex-direction: column; gap: .2rem; margin: 0; font-size: .82rem; color: #6b6a8a; min-width: 9rem; }
#app .ca-filters .filter-field select, #app .ca-filters .filter-field input { width: auto; min-width: 9rem; margin: 0; padding: .4rem .6rem; border-radius: 10px; }
.ca-filter-advanced { margin-top: .55rem; }
.ca-filter-advanced > summary { cursor: pointer; color: var(--accent-deep, #4b3fb3); font-size: .9rem; width: max-content; }
.ca-filter-advanced > .ca-filter-row { margin-top: .5rem; }
.ca-filter-note { font-size: .85rem; }
.list-search-empty button { margin-left: .4rem; }

/* Create CA: issuance method of an Issuing CA */
#app fieldset.choice-field { grid-column: 1 / -1; border: 1px solid var(--line, #e3e1f0); border-radius: 12px; padding: .6rem .9rem .7rem; margin: 0; }
#app fieldset.choice-field[hidden] { display: none; }
#app fieldset.choice-field legend { font-size: .85rem; color: #6b6a8a; padding: 0 .3rem; }
#app fieldset.choice-field label.check-line { display: flex; align-items: center; gap: .45rem; margin: .35rem 0 0; font-weight: 450; color: var(--ink); }
#app fieldset.choice-field label.check-line input { width: auto; margin: 0; }
#ca-csr-panel .facts { margin-top: .4rem; }
.import-report .test-checks { margin-top: .4rem; }
@media (max-width: 640px) {
  #app .ca-filters .filter-field, #app .ca-filters .filter-field select, #app .ca-filters .filter-field input { min-width: 0; width: 100%; }
  .ca-filter-row > .filter-field { flex: 1 1 45%; }
}

/* PQCTrust release badge in the top bar (from GET /system/info) */
.release-badge { margin-left: .55rem; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
  letter-spacing: .02em; color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); vertical-align: middle; }
.release-badge[hidden] { display: none; }

/* CA certificate lifecycle (PQCTrust 1.0): certificate status, renewal / cutover, revocation and external issuers */
.pill.REVOCATION_REQUESTED, .pill.AWAITING_EXTERNAL_CA, .pill.CONFIRMATION_RECEIVED, .pill.PLANNED, .pill.ROLLED_BACK,
.pill.FAILED_RETRYING { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.DISTRUSTED, .pill.VERIFIED_REVOKED, .pill.VERIFICATION_FAILED { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
.pill.CUT_OVER, .pill.PUBLISHED { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
.table-wrap .sub.cert-note { color: var(--bad); font-weight: 600; }
.table-wrap .sub.cert-note.EXPIRED, .table-wrap .sub.cert-note.REVOCATION_REQUESTED { color: var(--warn); }
#ca-lifecycle-panel .facts, .lifecycle-record .facts { margin-top: .4rem; }
#ca-lifecycle-panel h4, #modal-body h4 { margin: 1rem 0 .35rem; font-size: .9rem; }
.lifecycle-record { margin-top: .6rem; padding-top: .4rem; border-top: 1px solid var(--line, #e3e1f0); }
.lifecycle-list { list-style: none; margin: .3rem 0 0; padding: 0; font-size: .85rem; }
.lifecycle-list li { margin: .25rem 0; }
.lifecycle-subs { margin-top: .6rem; }
.lifecycle-steps { margin: .3rem 0 .6rem 1.2rem; padding: 0; }
.lifecycle-steps li { margin: .2rem 0; }
.fingerprint { font-family: var(--mono); word-break: break-all; }
#modal .warning { display: block; }
#modal fieldset.choice-field { border: 1px solid var(--line, #e3e1f0); border-radius: 12px; padding: .6rem .9rem .7rem; margin: .6rem 0; }
#modal fieldset.choice-field legend { font-size: .85rem; color: #6b6a8a; padding: 0 .3rem; }
#modal label.check-line { display: flex; align-items: center; gap: .45rem; margin: .45rem 0 0; font-weight: 450; color: var(--ink); }
#modal label.check-line input { width: auto; margin: 0; }
#xi-form textarea { width: 100%; }

/* Root CA: subordinate CA subject review, one attribute per row (field, value, remove). */
.subject-rows { display: grid; gap: .4rem; margin: .4rem 0 .6rem; }
.subject-row { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr auto; gap: .4rem; align-items: center; }
@media (max-width: 640px) { .subject-row { grid-template-columns: 1fr; } }

/* Password reset requests from the sign-in screen: a notice in the top bar for user managers (2026-11-25). */
#app .topbar .notice-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; border-radius: 999px;
  background: #fff; color: var(--bad); border: 0; font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
#app .topbar .notice-pill:hover { background: var(--bad-soft); }
#app .topbar .notice-pill[hidden] { display: none; }
.notice-pill__dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--bad); animation: notice-pulse 1.6s ease-in-out infinite; }
@keyframes notice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .notice-pill__dot { animation: none; } }
.card.help-requests { border-left: 4px solid var(--bad); }
.card.help-requests td .muted { font-size: .85rem; }

/* The answer of an action shown beside its buttons (e-mail reset card: Save, Send test message). */
.action-result { margin: .6rem 0 0; min-height: 1.2em; font-weight: 600; }
.action-result.ok { color: var(--ok, #127a3f); }
.action-result.bad { color: var(--bad); }

/* Deployments (remote TSA / OCSP trust nodes) */
.pill.OFFLINE, .pill.INSTALL_FAILED, .pill.CANCELLED { color: var(--bad); border-color: #f4bcc6; background: var(--bad-soft); }
.pill.SCHEDULED, .pill.NEEDED, .pill.CSR_RECEIVED, .pill.PROTOCOL_SWITCH_ONLY, .pill.RECOVERING, .pill.REFUSED { color: var(--warn); border-color: #f1dba5; background: var(--warn-soft); }
.pill.DONE, .pill.CA_ONLY, .pill.ALL_IN_ONE, .pill.OCSP_ONLY, .pill.TSA_ONLY, .pill.TRUST_SERVICES_ONLY { color: var(--ok); border-color: #b6e3d0; background: var(--ok-soft); }
#deploy-panel .row-actions { flex-wrap: wrap; }
#deploy-panel td .row-actions { margin: 0; gap: .3rem; }

/* Certificate requests waiting for approval (Dashboard notice) */
.approval-notice { border-left: 4px solid var(--warn); margin-bottom: 1rem; }
.approval-notice p { margin: .35rem 0 .6rem; }

/* Trust service page: collapsible report and integration help */
.view details { margin: 1rem 0; }
.view details > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }

/* OCSP multi-responder (2026-11-27): checkbox beside its text, grouped policy, CA cards */
#app label.check-line { display: flex; align-items: flex-start; gap: .5rem; margin: .45rem 0 0; font-weight: 450; color: var(--ink); }
#app label.check-line input[type="checkbox"] { width: auto; flex: none; margin: .2rem 0 0; }
#app fieldset.policy-group { border: 1px solid var(--line); border-radius: 12px; padding: .6rem 1rem 1rem; margin: 1rem 0 0; }
#app fieldset.policy-group legend { font-weight: 650; padding: 0 .4rem; color: var(--ink); }
#app .issuer-picker { display: grid; gap: .6rem; margin-top: .6rem; }
#app .issuer-card { margin: 0; padding: .8rem 1rem; }
#app .issuer-card.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
#app .issuer-card .card-head { margin-bottom: .2rem; }
#app .issuer-option span { line-height: 1.45; }
.field-warn { color: var(--warn); }
