:root {
  --navy: #172440;
  --navy2: #223458;
  --paper: #f6f5f2;
  --surface: #fff;
  --ink: #20242d;
  --muted: #697180;
  --gold: #b68235;
  --gold2: #7d5411;
  --line: #d8d9dc;
  --soft: #eceef2;
  --success: #26734d;
  --danger: #9a342d;
  --warning: #a46a12;
  --heading: "Cormorant Garamond", Georgia, serif;
  --body: Lora, Georgia, serif;
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background: var(--navy);
  padding: 5vw;
  gap: 6vw;
  align-items: center;
}
.auth-brand {
  color: white;
  max-width: 680px;
}
.auth-brand h1 {
  font: 400 clamp(48px, 7vw, 88px) / 0.95 var(--heading);
  margin: 18px 0;
}
.auth-brand > p:not(.kicker) {
  max-width: 560px;
  color: #c9d0de;
  font-size: 17px;
  line-height: 1.8;
}
.kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}
.requirement-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.requirement-strip span {
  border: 1px solid #66718a;
  padding: 7px 10px;
  color: #dfe4ef;
  font-size: 10px;
}
.auth-card {
  background: var(--paper);
  padding: 44px;
  box-shadow: 0 20px 70px #0a1020;
}
.wordmark {
  font: 600 36px/1 var(--heading);
  letter-spacing: -0.03em;
}
.wordmark span {
  color: var(--gold);
}
.wordmark.inverse {
  color: white;
}
.auth-card h2,
.dialog-card h2 {
  font: 400 38px/1 var(--heading);
  margin: 12px 0;
}
.auth-card > small {
  display: block;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 18px;
}
.muted {
  color: var(--muted);
  line-height: 1.65;
}
label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 18px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #bec2c9;
  background: white;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 0;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #d8b277;
  outline-offset: 1px;
  border-color: var(--gold);
}
.button {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold2);
  padding: 10px 15px;
  min-height: 42px;
  font-size: 12px;
}
.button.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.auth-card .button.primary {
  width: 100%;
  margin-top: 24px;
  min-height: 50px;
}
.button.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.button.danger {
  border-color: #d9aaa6;
  color: var(--danger);
}
.button.small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 10px;
}
.app-shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  width: 250px;
  inset: 0 auto 0 0;
  background: var(--navy);
  color: #eef1f7;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar-head {
  padding: 24px 22px;
  border-bottom: 1px solid #405071;
}
.sidebar-head small {
  display: block;
  margin-top: 7px;
  color: #9da8bc;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 8px;
}
.sidebar nav {
  padding: 12px 0;
  overflow: auto;
}
.sidebar nav button {
  display: flex;
  width: 100%;
  border: 0;
  background: transparent;
  color: #cbd2de;
  align-items: center;
  text-align: left;
  min-height: 49px;
  padding: 0 20px;
  gap: 0;
}
.sidebar nav button span {
  font-size: 12px;
}
.sidebar nav button:hover {
  background: #1d2d4d;
}
.sidebar nav button.active {
  background: #24385e;
  color: white;
  box-shadow: inset 3px 0 var(--gold);
}
.sidebar-account {
  margin-top: auto;
  border-top: 1px solid #405071;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-account > span {
  width: 35px;
  height: 35px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 13px var(--heading);
  color: #e0bc84;
}
.sidebar-account strong,
.sidebar-account small {
  display: block;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account strong {
  font-size: 10px;
}
.sidebar-account small {
  font-size: 8px;
  color: #9da8bc;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
main {
  margin-left: 250px;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  min-height: 86px;
  padding: 17px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 245, 242, 0.96);
  position: sticky;
  top: 0;
  z-index: 8;
}
.topbar h1 {
  font: 400 31px/1 var(--heading);
  margin: 4px 0 0;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.environment {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 8px;
}
.environment i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 5px;
}
.icon-button {
  display: none;
  border: 0;
  background: transparent;
  font-size: 20px;
  margin-right: 10px;
}
#content {
  padding: 28px 30px 60px;
  max-width: 1380px;
}
.notice {
  padding: 11px 14px;
  border: 1px solid #dcc28f;
  background: #fff9ed;
  color: #6d4a15;
  font-size: 12px;
  margin: 16px 30px 0;
}
.notice.error {
  background: #fff3f1;
  border-color: #dfaaa5;
  color: var(--danger);
  margin: 14px 0 0;
}
.notice.success {
  background: #eef9f3;
  border-color: #aad5bd;
  color: var(--success);
}
.page-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.filter-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-form label {
  margin: 0;
}
.filter-form input,
.filter-form select {
  min-height: 38px;
  margin-top: 4px;
  padding: 7px 9px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: white;
}
.metric {
  padding: 18px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 8px;
  color: var(--muted);
}
.metric strong {
  display: block;
  font: 400 34px/1 var(--heading);
  margin-top: 9px;
}
.metric.accent strong,
.metric.accent small {
  color: var(--gold2);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.panel h2,
.section-title {
  font: 600 18px var(--heading);
  margin: 0;
}
.panel-head small,
.section-meta {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--soft);
}
.list-row:last-child {
  border: 0;
}
.list-row strong,
.list-row small {
  display: block;
}
.list-row strong {
  font-size: 11px;
}
.list-row small {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fff3df;
  color: var(--gold2);
  white-space: nowrap;
}
.tag.success {
  background: #e8f5ed;
  color: var(--success);
}
.tag.danger {
  background: #faecea;
  color: var(--danger);
}
.tag.neutral {
  background: var(--soft);
  color: #5b6370;
}
.progress {
  height: 4px;
  background: var(--soft);
  margin-top: 8px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--gold);
}
.data-shell {
  border: 1px solid var(--line);
  background: white;
  overflow: auto;
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--soft);
  vertical-align: top;
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.data-table tr:hover td {
  background: #fcfaf6;
}
.data-table .actions {
  white-space: nowrap;
}
.data-table .actions .button {
  margin: 2px;
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
  font: italic 16px var(--heading);
}
.summary-bar {
  display: flex;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 12px;
}
.summary-bar b {
  color: var(--ink);
}
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.config-section {
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
}
.config-section.full {
  grid-column: 1/-1;
}
.config-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft);
}
.config-row input,
.config-row select {
  margin: 0;
  min-height: 37px;
  padding: 7px 8px;
  font-size: 11px;
}
.config-row:last-child {
  border: 0;
}
.audit-hash {
  font-family: monospace;
  font-size: 9px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid #abd2ba;
  background: #f4fbf7;
}
.status-card i {
  width: 12px;
  height: 12px;
  background: var(--success);
  border-radius: 50%;
}
/* FR-ADM-10: renderSecurity's login-history chain-verification banner reuses .status-card,
   toggling this variant when chainValid is false so a broken hash chain is visibly distinct
   from the default "verified" green state, not just present in the raw API response. */
.status-card.danger {
  border-color: var(--danger);
  background: #fbf1f0;
}
.status-card.danger i {
  background: var(--danger);
}
.status-card strong,
.status-card span {
  display: block;
}
.status-card strong {
  font-size: 12px;
}
.status-card span {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 620px);
  width: 100%;
}
dialog::backdrop {
  background: rgba(15, 23, 39, 0.72);
}
.dialog-card {
  background: var(--paper);
  padding: 28px;
  box-shadow: 0 25px 80px #101727;
}
.dialog-card.wide {
  max-height: 90vh;
  overflow: auto;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
fieldset {
  border: 1px solid var(--line);
  margin-top: 18px;
  padding: 13px;
}
legend {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.checkbox-grid label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.checkbox-grid input {
  width: auto;
  min-height: 0;
  margin: 0;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  padding-top: 18px;
}
.chart-bar {
  flex: 1;
  min-width: 40px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.chart-bar i {
  display: block;
  background: var(--navy2);
  min-height: 3px;
}
.chart-bar strong {
  font-size: 9px;
  margin: 7px 0 2px;
}
.chart-bar small {
  font-size: 8px;
  color: var(--muted);
}
@media (max-width: 980px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2,
  .config-grid {
    grid-template-columns: 1fr;
  }
  .config-section.full {
    grid-column: auto;
  }
  .top-actions .environment {
    display: none;
  }
}
@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
    padding: 26px 18px;
  }
  .auth-brand {
    display: none;
  }
  .auth-card {
    padding: 28px 22px;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  main {
    margin: 0;
  }
  .icon-button {
    display: block;
  }
  .topbar {
    padding: 14px 16px;
    min-height: 74px;
    gap: 6px;
  }
  .topbar > div:nth-child(2) {
    flex: 1;
    min-width: 0;
  }
  .topbar h1 {
    font-size: 25px;
    max-width: 32vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-actions .button:first-of-type {
    display: inline-flex;
  }
  .top-actions .button {
    align-items: center;
    font-size: 9px;
    min-height: 34px;
    padding: 6px 7px;
    white-space: nowrap;
  }
  #content {
    padding: 20px 14px 50px;
  }
  .notice {
    margin: 12px 14px 0;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric {
    border-bottom: 1px solid var(--line);
  }
  .page-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .config-row {
    grid-template-columns: 1fr;
  }
  .top-actions {
    gap: 4px;
  }
  .button {
    padding: 8px 10px;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}
