:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233c;
  background: #f3f6fb;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

a { color: #2458c6; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 5vw;
  background: #14213d;
  color: #fff;
}

.topbar a { color: #fff; }
.brand { color: #fff; font-weight: 800; letter-spacing: .04em; }
.brand-logo { max-width: 144px; max-height: 36px; margin-right: 8px; object-fit: contain; vertical-align: middle; }
.topbar .brand-logo { filter: brightness(0) invert(1); }
.login-logo { display: block; max-width: 240px; max-height: 72px; margin: 0 auto 18px; }
.topbar-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.topbar-nav a { color: #dbe5f6; font-size: .9rem; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions form { margin: 0; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 7px; color: #fff; font-weight: 700; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.account-menu[open] summary::after { transform: rotate(225deg); }
.account-dropdown { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 180px; padding: 6px; border: 1px solid #e0e6f0; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px rgb(22 42 79 / 18%); }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; color: #293d62; font: inherit; font-weight: 600; text-align: left; }
.account-dropdown a:hover, .account-dropdown button:hover { background: #e9eef8; color: #17233c; text-decoration: none; }
.account-dropdown form { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid #edf0f5; }
.container { width: min(1180px, 92vw); margin: 36px auto 64px; }
.narrow { width: min(900px, 92vw); }
.page-heading, .section-heading, .form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

h1 { margin: 4px 0 24px; font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { margin: 4px 0 16px; font-size: 1.15rem; }
p { line-height: 1.55; }
.eyebrow { margin: 0; color: #6d7d99; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.panel {
  padding: 24px;
  border: 1px solid #e0e6f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 20px rgb(22 42 79 / 4%);
}
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.section-panel { margin-top: 20px; }
.lower-cards { grid-template-columns: 1fr 1fr; margin-top: 20px; }
.section-heading { margin-bottom: 14px; }
.status { text-transform: capitalize; }
.status-healthy { color: #18774c; }
.status-degraded { color: #a26500; }
.status-unavailable { color: #b42332; }
.health-check-time { color: #75839b; font-size: .85rem; }
.pill { padding: 5px 10px; border-radius: 99px; background: #edf2fb; color: #435675; font-size: .8rem; }
code { overflow-wrap: anywhere; color: #384967; }
button, .button-link, .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  padding: 10px 15px;
  background: #2857c5;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button:hover, .button-link:hover { background: #1d459f; text-decoration: none; }
.button-secondary, .link-button { background: #e9eef8; color: #293d62; }
.button-secondary:hover, .link-button:hover { background: #dce5f4; text-decoration: none; }
.danger-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid #edf0f5; }
.button-danger { background: #b42332; }
.button-danger:hover { background: #8e1c29; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf0f5; vertical-align: top; }
th { color: #6d7d99; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.usage-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 16px; }
.usage-filter { min-width: 0; }
.usage-filter label { margin: 0 0 7px; }
.usage-filter .select-control { margin-top: 0; }
.usage-filters button { min-height: 46px; }
.usage-filter-note { margin: 12px 0 0; }
.usage-metric { margin: 10px 0 0; color: #17233c; font-size: 2rem; font-weight: 800; }
.usage-empty-state { border-left: 4px solid #d6a53c; }
.usage-chart-scroll { width: 100%; overflow: hidden; }
.usage-bar-chart { display: grid; width: 100%; grid-template-columns: repeat(var(--chart-columns), minmax(0, 1fr)); min-height: 195px; align-items: end; gap: clamp(1px, .6vw, 5px); padding: 12px 4px 0; border-bottom: 1px solid #dce3ee; }
.usage-bar-column { display: grid; min-width: 0; grid-template-rows: 1.2em 140px 2em; gap: 4px; text-align: center; }
.usage-bar-count, .usage-bar-label { overflow: hidden; color: #75839b; font-size: .68rem; white-space: nowrap; }
.usage-bar-track { display: flex; width: 100%; height: 140px; align-items: flex-end; border-radius: 4px 4px 0 0; background: #f0f3f8; }
.usage-bar { display: block; width: 100%; min-height: 0; border-radius: 4px 4px 0 0; }
.usage-bar-apps { background: #2857c5; }
.usage-bar-logins { background: #29956a; }
.usage-meter { display: block; width: min(140px, 100%); height: 10px; overflow: hidden; border-radius: 99px; background: #edf2fb; }
.usage-meter > span { display: block; height: 100%; border-radius: inherit; background: #2857c5; }
.property-row { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(0, 1.5fr) auto; align-items: center; gap: 12px; margin: 8px 0; }
.property-row.property-input-row { grid-template-columns: minmax(230px, .9fr) minmax(0, 1.5fr) auto; }
.property-row label { margin: 0; }
.property-row input { margin-top: 0; }
.property-field { margin: 16px 0; }
.property-field > input, .property-field > .select-control { margin-top: 0; }
.property-label-with-help { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; font-weight: 700; }
.property-label-with-help label { display: inline; margin: 0; }
.property-key-control { display: flex; min-width: 0; align-items: center; gap: 8px; }
.property-key-control input { min-width: 0; flex: 1 1 auto; }
.field-label-with-help { display: flex; align-items: center; gap: 8px; margin: 16px 0 7px; }
.field-label-with-help label { margin: 0; }
.property-info { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; vertical-align: middle; }
.property-info-trigger { display: inline-flex; width: 19px; height: 19px; align-items: center; justify-content: center; margin: 0; padding: 0; border: 1px solid #8593a9; border-radius: 50%; background: #f3f6fb; color: #435675; font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: help; }
.property-info-trigger:hover, .property-info-trigger:focus-visible { border-color: #2857c5; background: #e9eef8; color: #164b98; }
.property-info-trigger:focus-visible { outline: 3px solid rgb(40 87 197 / 25%); outline-offset: 2px; }
.property-info-popover { position: absolute; z-index: 50; bottom: calc(100% + 8px); left: 50%; width: min(300px, 72vw); padding: 12px 14px; border: 1px solid #324a71; border-radius: 8px; background: #14213d; box-shadow: 0 8px 24px rgb(22 42 79 / 20%); color: #fff; font-size: .84rem; font-weight: 400; line-height: 1.45; text-align: left; visibility: hidden; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .12s ease, transform .12s ease, visibility .12s ease; }
.property-info-popover > span { display: block; }
.property-info-popover a { display: inline-block; margin-top: 8px; color: #b9d1ff; font-weight: 700; text-decoration: underline; }
.property-info:hover .property-info-popover, .property-info:focus-within .property-info-popover { visibility: visible; opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.property-heading { margin-top: 18px; color: #6d7d99; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.clear-property { padding: 8px 10px; }
.clear-property:disabled { visibility: hidden; }
.password-control { position: relative; display: block; margin-top: 7px; }
.password-control input { margin-top: 0; padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 6px; display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; padding: 7px; border-radius: 6px; background: transparent; color: #5b6d88; transform: translateY(-50%); }
.password-toggle:hover { background: #e9eef8; color: #17233c; }
.password-toggle:focus-visible { outline: 3px solid rgb(40 87 197 / 25%); outline-offset: 1px; }
.password-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.password-toggle .eye-slash { display: block; }
.password-toggle.password-visible .eye-slash { display: none; }
.auth-mode-settings { margin-top: 20px; padding: 20px; border: 1px solid #e0e6f0; border-radius: 9px; }
.auth-mode-settings[hidden] { display: none; }
.auth-mode-settings legend { padding: 0 8px; color: #384967; font-weight: 800; }
.auth-setting-row { grid-template-columns: minmax(160px, .8fr) minmax(0, 1.5fr); }
.group-selector { min-height: 164px; margin-top: 0; background: #fff; }
.group-selector optgroup { color: #384967; font-weight: 700; }
.group-selector .admin-group-option { color: #b42332; font-weight: 700; }
.group-selection-help { margin: 8px 0 0; color: #6d7d99; font-size: .85rem; }
.ldap-provider { margin: 14px 0; padding: 16px; border: 1px solid #edf0f5; border-radius: 8px; }
.ldap-field { margin: 12px 0; }
.ldap-field input { margin-top: 0; }
.ldap-provider h3 { margin-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.revision-list { margin: 0; padding: 0; list-style: none; }
.revision-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.revision-list small { display: block; margin-top: 5px; color: #75839b; }
.revision-history-more { margin-top: 10px; }
.revision-history-more summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #e0e6f0; border-radius: 7px; background: #f7f9fc; color: #384967; font-weight: 700; cursor: pointer; list-style: none; }
.revision-history-more summary::-webkit-details-marker { display: none; }
.revision-history-more summary::after { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; transform: rotate(45deg); }
.revision-history-more[open] summary::after { transform: rotate(225deg); }
.revision-history-more .revision-list { padding: 0 10px; }
.log-list { max-height: 320px; overflow: auto; padding: 8px 12px; border-radius: 7px; background: #101a2d; color: #dbe5f6; font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-list p { margin: 4px 0; overflow-wrap: anywhere; }
.log-level { color: #87b6ff; }
.alert { padding: 12px 14px; border-radius: 7px; background: #fff0f0; color: #9f1d2b; }
label { display: block; margin: 16px 0; font-weight: 700; }
input, textarea, select { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid #cbd4e2; border-radius: 7px; font: inherit; }
.select-control { position: relative; display: block; margin-top: 7px; }
.select-control select { margin-top: 0; padding: 13px 44px 13px 14px; appearance: none; background: #fff; box-shadow: inset 0 1px 2px rgb(22 42 79 / 5%); color: #17233c; font-weight: 700; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.select-control::after { position: absolute; top: 50%; right: 16px; width: 8px; height: 8px; border-right: 2px solid #586b88; border-bottom: 2px solid #586b88; content: ""; pointer-events: none; transform: translateY(-70%) rotate(45deg); }
.select-control:hover select { border-color: #9aaac1; }
.select-control:focus-within select { border-color: #2857c5; outline: none; box-shadow: 0 0 0 3px rgb(40 87 197 / 18%); }
.select-control select:focus-visible { outline: none; }
textarea { resize: vertical; font: .83rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-actions { justify-content: flex-end; margin-top: 18px; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.login-panel { width: min(430px, 100%); }
.login-panel h1 { font-size: 1.75rem; }

@media (max-width: 840px) {
  .cards, .lower-cards { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .topbar { justify-content: center; padding: 12px 5vw; }
  .topbar-nav { justify-content: center; }
}

@media (max-width: 500px) {
  .topbar { padding: 0 4vw; }
  .topbar-actions { gap: 10px; }
  .panel { padding: 18px; }
  .usage-filters { grid-template-columns: 1fr; }
  .usage-filters button { justify-self: start; }
  .property-row { grid-template-columns: 1fr; gap: 5px; }
  .property-row.property-input-row { grid-template-columns: minmax(0, 1fr) auto; }
  .property-row.property-input-row > input[name="property_values"] { grid-column: 1 / -1; }
  .property-row.property-input-row > .clear-property { grid-column: 2; grid-row: 1; justify-self: end; }
  .property-heading { display: none; }
}
