:root {
  color-scheme: light;
  /* Colours follow the UBS palette: black and white, warm greys, and UBS red as the single accent. */
  --ink: #1c1c1c;
  --muted: #5f5f5a;
  --line: #dddbd3;
  --paper: #f6f5f1;
  --surface: #fff;
  --accent: #1c1c1c;
  --accent-soft: #eeede8;
  --brand: #e60000;
  --brand-dark: #b30000;
  --neutral-soft: #f1f0eb;
  --input-line: #c8c6bd;
  --row-line: #ebe9e3;
  --shadow: 0 12px 32px rgba(0, 0, 0, .06);
  /* UBS sets everything in Frutiger. It is a licensed font, so it is used where installed; otherwise the closest common fonts are. */
  --font: "Frutiger", "Frutiger LT Std", "Frutiger LT Pro", "Frutiger Next Pro", "Neue Frutiger World", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bs-body-font-family: var(--font);
  font-family: var(--font);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
.navbar { min-height: 68px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); background: var(--surface) !important; border: 0 !important; border-top: 4px solid var(--brand) !important; border-bottom: 1px solid var(--line) !important; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.navbar .container { max-width: 1280px; padding: 0; }
.navbar-brand { color: var(--ink) !important; font-family: var(--font); font-size: 21px; font-weight: 700; }
.navbar-brand::first-letter { color: var(--brand); }
.navbar-nav { flex-wrap: wrap; column-gap: 4px; }
/* With many areas the links wrap onto a second row instead of pushing the account links off the page. */
.navbar .navbar-collapse { min-width: 0; }
.navbar .nav-link { color: var(--ink) !important; font-size: 14px; white-space: nowrap; }
.navbar .nav-link:hover, .navbar .nav-link:focus { color: var(--brand-dark) !important; }
.navbar .btn-link { color: inherit; text-decoration: none; }
.app-main { width: min(1280px, calc(100% - 48px)); min-height: calc(100vh - 68px); margin: 0 auto; padding: 44px 0 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.compact-heading { align-items: center; margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-family: var(--font); font-size: 36px; font-weight: 600; line-height: 1.14; }
h2 { margin: 0 0 16px; font-family: var(--font); font-size: 21px; font-weight: 600; }
.page-intro { margin: 8px 0 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 20px; }
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { background: var(--neutral-soft); border-color: #b9b7ad; }
.btn-danger { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.text-link { color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--neutral-soft); }
.filter-bar label, .form-field { display: flex; flex-direction: column; gap: 6px; }
.filter-bar label > span, .form-field > span, .form-field legend { color: #3a3a37; font-size: 12px; font-weight: 700; }
.search-field { flex: 1 1 360px; }
.filter-field { flex: 1 1 170px; max-width: 240px; }
.filter-bar input, .filter-bar select, .form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); border: 1px solid var(--input-line); border-radius: 4px; background: var(--surface); font: inherit; }
.form-field textarea { min-height: 106px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(230, 0, 0, .25); outline-offset: 2px; border-color: var(--brand) !important; }
.results-line { display: flex; justify-content: space-between; margin: 20px 0 10px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; color: var(--muted); background: #f4f3ef; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 800; text-align: left; text-transform: uppercase; }
.data-table td { padding: 15px 16px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfaf7; }
.record-link { color: var(--accent); font-weight: 750; text-decoration: none; }
.cell-subtitle { display: block; max-width: 440px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.row-action { width: 70px; color: var(--muted); text-align: right !important; white-space: nowrap; }
.row-action a, .link-button { color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; }
.row-action form { display: inline; }
.row-action > * + * { margin-left: 14px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.auth-form { max-width: 480px; }
.empty-state { padding: 42px 16px !important; color: var(--muted); text-align: center; }
.strategy, .account-role, .owner-type, .count-label { display: inline-flex; align-items: center; border-radius: 3px; font-size: 12px; font-weight: 750; }
.strategy { padding: 5px 9px; color: #24563e; background: #e5f2e5; }
.strategy-invest { color: #264a74; background: #e6eef7; }
.strategy-migrate { color: #78531b; background: #f5eedc; }
.strategy-eliminate { color: #8a3929; background: #f7e8e2; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status::before { width: 8px; height: 8px; border-radius: 50%; background: currentColor; content: ""; }
.status-plan { color: #5b6b8c; }
.status-build { color: #9a6a12; }
.status-active { color: #2c7a4b; }
.status-retired { color: #8a8f8b; }
.approval { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.approval::before { width: 8px; height: 8px; border-radius: 50%; background: currentColor; content: ""; }
.approval-approved { color: #2c7a4b; }
.approval-restricted { color: #9a6a12; }
.approval-prohibited { color: #b84638; }
.approval-undeclared { color: #8a8f8b; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab-list [role="tab"] { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 10px 16px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: none; font-size: 14px; font-weight: 700; cursor: pointer; }
.tab-list [role="tab"]:hover { color: var(--ink); }
.tab-list [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab-list [role="tab"].has-error { color: #b84638; }
.tab-list [role="tab"].has-error::after { content: "!"; }
.tab-count { padding: 1px 7px; color: var(--accent); border-radius: 10px; background: var(--accent-soft); font-size: 12px; }
.tab-attention { color: #b84638; font-size: 12px; }
.detail-main > .tab-list { margin-bottom: 0; padding: 8px 12px 0; }
.bom-table select, .bom-table input[type="text"] { width: 100%; min-height: 38px; padding: 7px 10px; color: var(--ink); border: 1px solid var(--input-line); border-radius: 4px; background: var(--surface); }
.bom-count { white-space: nowrap; }
.severity { display: inline-block; min-width: 62px; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; text-align: center; }
.severity-high { color: #8d3027; background: #f8e9e5; }
.severity-medium { color: #7a5410; background: #f7efdc; }
.severity-low { color: #3a3a37; background: var(--neutral-soft); }
.quality-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quality-card { display: grid; gap: 4px; padding: 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.quality-card:hover { border-color: #b9b7ad; }
.quality-card strong { font-size: 26px; }
.quality-card-title { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.quality-kind { margin: 28px 0 10px; font-size: 18px; }
.failed-rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.failed-rules li { display: flex; align-items: center; gap: 10px; }
.rule-guidance { white-space: pre-line; }
.app-id { color: var(--muted); font-family: Consolas, "Courier New", monospace; font-size: 13px; white-space: nowrap; }
.account-role { padding: 4px 8px; color: #3a3a37; background: var(--neutral-soft); }
.role-admin { color: #82402b; background: #f8ece5; }
.record-form { max-width: 900px; }
.form-section { margin-bottom: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.form-section h2 { padding-bottom: 14px; border-bottom: 1px solid var(--row-line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-two { grid-column: 1 / -1; }
.form-field b { color: var(--brand); }
fieldset.form-field { min-width: 0; padding: 0; border: 0; }
.form-field legend { float: none; width: auto; margin-bottom: 8px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-option { display: flex; min-height: 40px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fcfbf8; font-size: 14px; }
.check-option input { width: 16px; min-height: 16px; accent-color: var(--accent); }
.read-only-value { display: flex; min-height: 42px; align-items: center; margin: 0; padding: 9px 11px; color: var(--muted); border: 1px dashed var(--input-line); border-radius: 4px; background: #f6f8f5; font-family: Consolas, "Courier New", monospace; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.picker-chips:empty { display: none; }
.picker-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; color: var(--accent); border: 1px solid #d6d4cb; border-radius: 999px; background: var(--accent-soft); font-size: 14px; font-weight: 650; }
.chip-remove { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; padding: 0; color: inherit; border: 0; border-radius: 50%; background: none; font-size: 17px; line-height: 1; cursor: pointer; }
.chip-remove:hover, .chip-remove:focus-visible { color: #fff; background: var(--accent); }
.picker-search { position: relative; }
.picker-search input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--input-line); border-radius: 4px; background: var(--surface); font: inherit; }
.picker-results { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; left: 0; max-height: 320px; margin: 0; padding: 4px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 28px rgba(23, 39, 32, .14); list-style: none; }
.picker-option { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.picker-option[aria-selected="true"] { background: var(--accent-soft); }
.picker-option-detail { color: var(--muted); font-size: 12px; }
.picker-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.field-error { color: #a9362d; font-size: 12px; }
.field-note, .muted-copy { color: var(--muted); font-size: 13px; }
.form-actions { display: flex; gap: 10px; }
.validation-summary:empty { display: none; }
.validation-summary:not(:empty) { margin-bottom: 16px; padding: 12px 14px; color: #8d3027; border-left: 3px solid #b84638; background: #f8e9e5; }
.validation-summary ul { margin: 0; padding-left: 20px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.detail-layout.single { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.detail-main, .detail-aside { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.detail-section { padding: 24px; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--row-line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 13px; font-weight: 650; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.section-heading-with-action { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.flag-values { display: flex; flex-wrap: wrap; gap: 6px; }
.flag-value { padding: 3px 9px; color: var(--accent); border-radius: 3px; background: var(--accent-soft); font-size: 13px; font-weight: 700; }
.flag-owner { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.choice-group { display: inline-flex; overflow: hidden; border: 1px solid var(--input-line); border-radius: 4px; background: var(--surface); }
.choice { position: relative; display: flex; align-items: center; margin: 0; cursor: pointer; }
.choice + .choice { border-left: 1px solid var(--input-line); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { padding: 9px 16px; font-size: 14px; }
.choice input:checked + span { color: #fff; background: var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.option-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
.option-row input[type="text"] { min-height: 40px; padding: 8px 10px; border: 1px solid var(--input-line); border-radius: 4px; font: inherit; }
.option-row .usage { color: var(--muted); font-size: 12px; white-space: nowrap; }
.option-row .span-row { grid-column: 1 / -1; }
.option-move { display: inline-flex; gap: 10px; }
.option-add { margin-top: 18px; }
.flag-create .form-actions { margin-top: 16px; }
.flag-create { max-width: none; }
.count-label { margin-left: 6px; padding: 3px 7px; color: var(--muted); background: var(--neutral-soft); }
.person-list { margin: 0; padding: 0; list-style: none; }
.person-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--row-line); }
.person-list li:last-child { border-bottom: 0; }
.detail-aside { padding: 23px; border-top: 4px solid var(--brand); }
.detail-aside h2 { margin-bottom: 6px; }
.detail-aside p:not(.eyebrow) { margin: 3px 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.owner-type { margin-top: 14px; padding: 5px 8px; color: var(--accent); background: var(--accent-soft); }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; padding: 18px 20px; border: 1px solid #ead0c7; border-radius: 6px; background: #fbf3f0; }
.danger-zone div { display: grid; gap: 3px; }
.danger-zone span { color: var(--muted); font-size: 13px; }
.directory-create { margin-bottom: 26px; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.directory-create h2 { margin-bottom: 14px; font-size: 19px; }
.inline-form { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; align-items: end; gap: 12px; }
.organisation-form { grid-template-columns: minmax(200px, 2fr) minmax(110px, 1fr) minmax(120px, 1fr) minmax(220px, 2fr) auto; }
/* The organisation tree: each level is indented under its parent, and labelled. */
.tree-depth-1 { padding-left: 22px; }
.tree-depth-2 { padding-left: 44px; }
.tree-depth-3 { padding-left: 66px; }
.org-level { display: inline-block; padding: 2px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; font-size: 12px; font-weight: 700; }
.org-path { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; color: var(--muted); font-size: 13px; list-style: none; }
.org-path li + li::before { content: "›"; margin-right: 6px; }
.category-form { grid-template-columns: minmax(220px, 480px) auto; justify-content: start; }
.role-type-form { grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.4fr) auto auto; }
.role-list { display: grid; gap: 14px; }
.role-row { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fcfbf8; }
.role-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.role-heading h3 { margin: 0; font-size: 16px; font-weight: 750; }
.role-heading b { color: var(--brand); }
.role-holder { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.role-deputies { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.account-create .inline-form { grid-template-columns: minmax(200px, 1fr) minmax(180px, 1fr) minmax(140px, .7fr) auto; }
.inline-form .validation-summary { grid-column: 1 / -1; }
.alert { margin-bottom: 20px; border-radius: 4px; }
.footer { display: none; }
@media (max-width: 800px) {
  .navbar { padding: 0 18px; }
  .app-main { width: calc(100% - 36px); padding-top: 30px; }
  .page-heading { align-items: start; }
  .filter-bar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .filter-field { flex: 1 1 210px; max-width: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { order: -1; }
  .inline-form, .account-create .inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form > button { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  h1 { font-size: 30px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 18px; }
  .heading-actions { flex-wrap: wrap; }
  .form-section { padding: 18px; }
  .form-grid, .checkbox-grid, .inline-form, .organisation-form, .category-form, .role-type-form, .account-create .inline-form { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
  .person-list li { flex-direction: column; gap: 1px; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone .btn { width: 100%; }
  .filter-bar .btn { flex: 1; }
  .navbar .navbar-collapse { padding-bottom: 12px; }
}

/* Home page */
.home-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 28px; }
.home-area { display: grid; grid-template-rows: auto auto 1fr; gap: 4px; padding: 16px 18px; color: var(--ink); border: 1px solid var(--line); border-top: 3px solid transparent; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; }
.home-area:hover, .home-area:focus-visible { border-top-color: var(--brand); }
.home-area-name { font-size: 16px; font-weight: 700; }
.home-area-count { font-size: 26px; line-height: 1.1; }
.home-area-description { color: var(--muted); font-size: 13px; }
.home-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.home-panel { padding: 22px 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.home-subheading { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.home-list { margin: 0; padding: 0; list-style: none; }
.home-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--row-line); }
.home-list li:last-child { border-bottom: 0; }
.home-failing { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.home-score { margin: 0 0 12px; }
.home-score strong { font-size: 26px; }
.home-severities { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.home-severities li { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 420px) { .home-panels { grid-template-columns: 1fr; } }

/* People: the administrator actions wrap within their column instead of widening the table. */
.page-heading > .btn { flex-shrink: 0; white-space: nowrap; }
.row-action.people-actions { width: 250px; min-width: 250px; white-space: normal; line-height: 1.9; }
.people-actions > * + * { margin-left: 12px; }
.people-status { white-space: nowrap; }

/* Licence entitlement tiers. */
.tier { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 3px; font-size: 12px; font-weight: 750; }
.tier-gold { color: #6f5200; background: #f6ebc4; }
.tier-silver { color: #44464f; background: #e7e8ec; }
.tier-bronze { color: #7a3d14; background: #f3dfd0; }
