:root {
  --cc-blue: #001864;
  --cc-yellow: #ffc20e;
  --bg: #f8f9fc;
  --paper: #f2f4f9;
  --panel: #ffffff;
  --line: #d9deea;
  --text: #142044;
  --muted: #59657d;
  --nav-text: #52638d;
  --nav-hover: #e7ebf4;
  --table-bg: #ffffff;
  --table-head: #eef1f6;
  --table-line: #d9deea;
  --table-text: #142044;
  --table-hover: #f3f5f9;
  --table-control: #ffffff;
  --green: #247d35;
  --red: #c11b25;
  --orange: #9d7100;
  --purple: #7551a6;
  --drawer-width: 220px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.login-view { display: none; min-height: 100vh; background: var(--bg); }
body.auth-pending .app-shell { visibility: hidden; }
body.auth-pending .login-view { display: block; visibility: hidden; }
body.logged-out .app-shell { display: none; }
body.logged-out .login-view { display: block; }
.login-content { position: fixed; top: 50%; left: 50%; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -54%); }
.login-wordmark { display: block; width: min(80vw, 430px); height: auto; object-fit: contain; }
.login-theme-button {
  position: fixed;
  top: 32px;
  right: 32px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--cc-blue);
  font-size: 17px;
  font-weight: 750;
}
.sso-login-button {
  min-height: 42px;
  margin-top: 14px;
  padding: 8px 17px;
  border: 1px solid var(--cc-yellow);
  border-radius: 7px;
  background: var(--panel);
  color: #e7a900;
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .14);
}
.sso-login-button:hover { background: #fff9e8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.top-appbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--cc-blue); font-size: 18px; font-weight: 700; }
.brand img { width: 34px; height: 28px; object-fit: contain; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-actions { margin-left: auto; display: flex; gap: 9px; }
.icon-button, .avatar-button, .grid-footer button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--cc-blue);
}
.icon-button:hover, .avatar-button:hover { background: var(--nav-hover); }
.avatar-button { position: relative; overflow: hidden; padding: 3px; background: rgba(245, 246, 250, .3); border-radius: 8px; }
.avatar-button img, .profile-initials {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.avatar-button img { object-fit: cover; }
.profile-initials { display: grid; place-items: center; background: var(--cc-blue); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
.avatar-button img[hidden], .profile-initials[hidden] { display: none; }

.drawer {
  position: fixed;
  inset: 64px auto 0 0;
  z-index: 15;
  width: var(--drawer-width);
  padding: 10px 6px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  transition: width 160ms ease, transform 160ms ease;
}
.drawer nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item, .nav-group-toggle, .nested {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 12px 6px 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--nav-text);
  text-align: left;
  font-weight: 600;
}
.nav-group[hidden] { display: none; }
.nav-item > span:first-child, .nav-group-toggle > span:first-child { width: 19px; flex: 0 0 19px; text-align: center; }
.nav-item:hover, .nav-group-toggle:hover, .nested:hover { color: var(--cc-blue); background: var(--nav-hover); }
.nav-item.active, .nested.active { color: var(--cc-blue); background: var(--panel); border-left-color: var(--cc-yellow); font-weight: 750; }
.nav-group-toggle strong { margin-left: auto; transition: transform 150ms ease; }
.nav-group:not(.expanded) .nav-group-toggle strong { transform: rotate(-90deg); }
.nav-group:not(.expanded) .nav-children { display: none; }
.nested { min-height: 35px; padding-left: 42px; font-size: 13px; }

.content { margin-left: var(--drawer-width); padding: 91px 26px 34px; transition: margin-left 160ms ease; }
body.drawer-collapsed { --drawer-width: 64px; }
body.drawer-collapsed .nav-label, body.drawer-collapsed .nav-group-toggle strong, body.drawer-collapsed .nav-children { display: none; }
body.drawer-collapsed .nav-item, body.drawer-collapsed .nav-group-toggle { justify-content: center; padding: 6px; }

.view { display: none; }
.view.active { display: block; }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
h1 { margin: 0; color: var(--cc-blue); font-size: 25px; line-height: 1.35; font-weight: 650; }
.page-title p { margin: 6px 0 0; color: var(--muted); }
.primary-button, .secondary-button, .view-button {
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid var(--cc-yellow);
  border-radius: 7px;
  background: var(--cc-blue);
  color: #fff;
  font-weight: 650;
}
.primary-button:hover { background: #0d2c85; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { align-self: end; background: transparent; color: var(--cc-blue); border-color: var(--cc-blue); }
.secondary-button:hover { background: var(--nav-hover); }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.summary-card {
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}
.summary-card:hover, .summary-card.selected { border-color: var(--cc-yellow); box-shadow: 0 4px 14px rgba(0, 24, 100, .09); }
.summary-icon { width: 42px; display: grid; place-items: center; color: var(--cc-blue); font-size: 29px; font-weight: 800; }
.summary-icon.warning { color: var(--orange); }
.summary-icon.soon { color: var(--purple); }
.summary-icon.expired { color: var(--red); }
.summary-card strong { display: block; color: var(--cc-blue); font-size: 27px; font-weight: 650; }
.summary-card small { display: block; margin-top: 3px; color: var(--text); font-size: 14px; }

.asset-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}
label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
input, select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); }
textarea { width: 100%; min-height: 68px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--cc-yellow); outline-offset: 2px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.section-heading h2 { margin: 0; color: var(--cc-blue); font-size: 20px; font-weight: 650; }
.section-heading span { color: var(--muted); }
.data-grid, .audit-grid { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--table-bg); color: var(--table-text); }
.table-scroll { min-height: 380px; overflow: auto; }
.audit-scroll { min-height: 420px; max-height: calc(100vh - 180px); }
table { width: 100%; min-width: 1120px; border-collapse: collapse; color: var(--table-text); }
#assetTable { min-width: 1480px; }
.audit-grid table { min-width: 940px; }
th, td { height: 54px; padding: 0 11px; border-bottom: 1px solid var(--table-line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--table-head); font-weight: 600; }
td { background: var(--table-bg); }
#assetRows tr { cursor: pointer; }
#assetRows tr:hover td, #assetRows tr:focus-within td { background: var(--table-hover); }
.serial { color: #4253ae; }
.serial-button { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 650; }
.serial-button:hover { color: var(--cc-yellow); }
.asset-name { font-weight: 650; }
.empty { height: 300px; text-align: center; font-weight: 600; }
.view-button { min-height: 32px; padding: 4px 10px; background: transparent; color: var(--cc-yellow); }
.audit-action { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: #4253ae; font-weight: 650; }
.audit-action:hover { color: var(--cc-yellow); }
.grid-footer { min-height: 54px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 7px 15px; background: var(--table-head); }
.grid-footer select { width: 68px; height: 34px; color: var(--table-text); background: var(--table-control); border-color: var(--line); }
.grid-footer label { color: var(--muted); }
.grid-footer button { width: 33px; height: 33px; color: var(--table-text); background: var(--table-control); border-color: var(--line); }
.grid-footer button:disabled { opacity: .35; cursor: default; }
.status { display: inline-flex; justify-content: center; min-width: 78px; padding: 4px 8px; border-radius: 6px; color: #fff; font-weight: 700; }
.status.healthy { background: var(--green); }
.status.warning { background: var(--orange); }
.status.critical, .status.expired { background: var(--red); }
.status.unknown { background: #59657d; }

.asset-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.asset-dialog::backdrop { background: rgba(6, 8, 12, .68); }
.audit-dialog { width: min(700px, calc(100vw - 32px)); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.dialog-header .icon-button { color: var(--text); background: var(--bg); border-color: var(--line); font-size: 23px; font-weight: 700; line-height: 1; }
.dialog-header .icon-button:hover { color: var(--cc-blue); background: var(--nav-hover); border-color: var(--cc-yellow); }
.dialog-eyebrow { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.dialog-header h2 { margin: 0; color: var(--cc-blue); font-size: 22px; }
#assetDialog > .dialog-header { padding: 16px; }
.metadata-editor { padding: 16px; border-bottom: 1px solid var(--line); }
.metadata-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dialog-section-heading { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 14px; text-transform: uppercase; }
.metadata-fields .dialog-section-heading { grid-column: 1 / -1; }
.metadata-editor label > span, .renewal-editor label > span { margin-bottom: 2px; font-size: 12px; line-height: 14px; }
.metadata-editor input, .renewal-editor input { height: 32px; }
#assetDialog input:not([type="checkbox"]):focus { outline-offset: -2px; }
.vdom-setting-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr); align-items: start; gap: 10px; }
.metadata-checkbox { min-height: 32px; display: flex; align-items: center; gap: 9px; padding-top: 0; }
.metadata-checkbox > span { display: inline; margin: 0; color: var(--text); font-size: 14px; }
.metadata-checkbox input { appearance: auto; width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: var(--cc-blue); }
.metadata-vdom-count[hidden] { display: none; }
.metadata-vdom-count input:disabled { background: var(--paper); color: var(--muted); opacity: .68; cursor: not-allowed; }
.metadata-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.metadata-editor .primary-button { min-width: 82px; }
.metadata-editor .save-state { min-height: 18px; color: var(--green); font-size: 13px; font-weight: 650; }
.renewal-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.renewal-editor[hidden] { display: none; }
.renewal-editor .dialog-section-heading { grid-column: 1 / -1; }
.renewal-editor .primary-button { min-width: 82px; }
.renewal-editor .save-state { grid-column: 1 / -1; min-height: 18px; color: var(--green); font-size: 13px; font-weight: 650; }
.save-state[data-outcome="pending"] { color: var(--muted); }
.save-state[data-outcome="success"] { color: var(--green); }
.save-state[data-outcome="error"] { color: var(--red); }
.asset-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 8px 22px 22px; }
.detail-field { min-width: 0; padding: 15px 0; border-bottom: 1px solid var(--line); }
.detail-field:nth-child(odd) { padding-right: 18px; }
.detail-field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.detail-field strong { display: block; overflow-wrap: anywhere; font-weight: 600; }
.detail-field.full { grid-column: 1 / -1; padding-right: 0; }
.support-list { columns: 2; column-gap: 28px; margin: 0; padding-left: 18px; }
.support-list li { min-width: 0; margin: 0 0 7px; padding-right: 8px; break-inside: avoid; overflow-wrap: anywhere; font-weight: 600; }
#assetDialog > .dialog-section-heading { padding: 12px 16px 0; }
#assetDialog .asset-detail { padding: 4px 16px 16px; }
#assetDialog .detail-field { padding: 10px 0; }
#assetDialog .detail-field:nth-child(odd) { padding-right: 14px; }
#assetDialog .detail-field span { margin-bottom: 3px; }
#assetDialog .support-list { column-gap: 22px; }
#assetDialog .support-list li { margin-bottom: 5px; }

body.dark-mode {
  --bg: #11151c;
  --paper: #171c25;
  --panel: #202733;
  --line: #364052;
  --text: #f0f3f8;
  --muted: #aab4c6;
  --nav-text: #c6cedd;
  --nav-hover: #252e3d;
  --table-bg: #06080c;
  --table-head: #0d1118;
  --table-line: #202632;
  --table-text: #ffffff;
  --table-hover: #111720;
  --table-control: #0b0f15;
  color-scheme: dark;
}
body.dark-mode .brand, body.dark-mode h1, body.dark-mode .section-heading h2, body.dark-mode .summary-card strong, body.dark-mode .dialog-header h2 { color: var(--cc-yellow); }
body.dark-mode .nav-item:hover, body.dark-mode .nav-group-toggle:hover, body.dark-mode .nested:hover { color: #fff; }
body.dark-mode .nav-item.active, body.dark-mode .nested.active { color: #fff; background: #272f3d; }
body.dark-mode .summary-card small { color: #e4e8ef; }
body.dark-mode .secondary-button { color: var(--cc-yellow); border-color: var(--cc-yellow); }
body.dark-mode .primary-button { color: #10151d; background: var(--cc-yellow); }
body.dark-mode .serial, body.dark-mode .audit-action { color: #a9a9ff; }
body.dark-mode .dialog-header .icon-button { color: #fff; background: #11151c; border-color: #59657d; }
body.dark-mode .dialog-header .icon-button:hover { color: var(--cc-yellow); border-color: var(--cc-yellow); }
body.dark-mode #menuButton, body.dark-mode #themeButton { color: #fff; background: #252e3d; border-color: #59657d; font-size: 17px; font-weight: 800; }
body.dark-mode #menuButton:hover, body.dark-mode #themeButton:hover { color: var(--cc-yellow); background: #303a4b; border-color: var(--cc-yellow); }
body.dark-mode .avatar-button { background: #0d1118; border-color: #59657d; }
body.dark-mode .avatar-button:hover { border-color: var(--cc-yellow); background: #171d27; }
body.dark-mode .profile-initials { background: var(--cc-yellow); color: #10151d; }
body.dark-mode .login-theme-button { color: #fff; background: #05070a; border-color: #59657d; }
body.dark-mode .login-theme-button:hover { color: var(--cc-yellow); border-color: var(--cc-yellow); }
body.dark-mode .sso-login-button { color: var(--cc-blue); background: var(--cc-yellow); }
body.dark-mode .sso-login-button:hover { background: #ffd24d; }

@media (max-width: 1000px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root { --drawer-width: 220px; }
  .drawer { transform: translateX(-100%); box-shadow: 10px 0 30px rgba(0,0,0,.24); }
  body.mobile-drawer-open .drawer { transform: translateX(0); }
  body.drawer-collapsed { --drawer-width: 220px; }
  body.drawer-collapsed .nav-label, body.drawer-collapsed .nav-group-toggle strong, body.drawer-collapsed .nav-children { display: initial; }
  body.drawer-collapsed .nav-item, body.drawer-collapsed .nav-group-toggle { justify-content: flex-start; padding: 6px 12px 6px 10px; }
  .content { margin-left: 0; padding: 86px 14px 24px; }
  #assetDialog .support-list { columns: 1; }
  .brand span { display: none; }
  .login-theme-button { top: 16px; right: 16px; }
  .login-wordmark { width: min(88vw, 390px); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-card { min-height: 94px; padding: 14px; gap: 8px; }
  .summary-icon { width: 30px; font-size: 24px; }
  .summary-card strong { font-size: 23px; }
  .summary-card small { font-size: 12px; }
  .asset-toolbar { grid-template-columns: 1fr; }
  .secondary-button { justify-self: start; }
  .asset-detail { grid-template-columns: 1fr; }
  .metadata-fields { grid-template-columns: 1fr; }
  .vdom-setting-row, .renewal-editor { grid-template-columns: 1fr; }
  .metadata-checkbox { min-height: 32px; }
  .renewal-editor .dialog-section-heading, .renewal-editor .save-state { grid-column: auto; }
  .renewal-editor .primary-button { justify-self: start; }
  .detail-field, .detail-field:nth-child(odd) { padding-right: 0; }
  .detail-field.full { grid-column: auto; }
}
