/* ai-inventory – design tokens, mobile-first (iPhone SE 375px) to xxl; no inline styles (CSP). */
:root {
  /* Seschat brand: night blue + gold on cream */
  --aii-primary: #14213D;
  --aii-gold: #C9973A;
  --aii-cream: #F6F2EA;
  --bs-primary: #14213D;
  --bs-primary-rgb: 20, 33, 61;
  --bs-link-color: #14213D;
  --bs-link-color-rgb: 20, 33, 61;
  --bs-link-hover-color: #0b1326;
  --bs-link-hover-color-rgb: 11, 19, 38;
  --aii-radius: .75rem;
  --aii-touch: 44px;
  --aii-sidebar: 250px;
  --aii-muted-bg: #f8f9fa;
}
[data-bs-theme="dark"] { --aii-muted-bg: #1d2024; --bs-link-color: #C9973A; --bs-link-color-rgb: 201, 151, 58; --bs-link-hover-color: #e0b76a; --bs-link-hover-color-rgb: 224, 183, 106; }
.btn-primary { --bs-btn-bg: #14213D; --bs-btn-border-color: #14213D; --bs-btn-hover-bg: #1f3260; --bs-btn-hover-border-color: #1f3260; --bs-btn-active-bg: #0b1326; --bs-btn-active-border-color: #0b1326; --bs-btn-disabled-bg: #14213D; --bs-btn-disabled-border-color: #14213D; }
.btn-outline-primary { --bs-btn-color: #14213D; --bs-btn-border-color: #14213D; --bs-btn-hover-bg: #14213D; --bs-btn-hover-border-color: #14213D; --bs-btn-active-bg: #14213D; --bs-btn-active-border-color: #14213D; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #C9973A; --bs-btn-border-color: #C9973A; --bs-btn-hover-bg: #C9973A; --bs-btn-hover-color: #14213D; --bs-btn-hover-border-color: #C9973A; --bs-btn-active-bg: #C9973A; --bs-btn-active-border-color: #C9973A; }
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #C9973A; --bs-btn-border-color: #C9973A; --bs-btn-color: #14213D; --bs-btn-hover-bg: #e0b76a; --bs-btn-hover-border-color: #e0b76a; --bs-btn-hover-color: #14213D; --bs-btn-active-bg: #b5862f; --bs-btn-active-border-color: #b5862f; }
.text-primary { color: #14213D !important; }
[data-bs-theme="dark"] .text-primary { color: #C9973A !important; }
.text-gold { color: var(--aii-gold); }
.form-check-input:checked { background-color: #14213D; border-color: #14213D; }
.progress-bar { background-color: #14213D; }
[data-bs-theme="dark"] .progress-bar { background-color: #C9973A; }
.brand-emblem { height: 32px; width: auto; }
.brand-name { font-weight: 600; letter-spacing: .02em; }
.brand-dark { display: none; }
[data-bs-theme="dark"] .brand-dark { display: inline-block; }
[data-bs-theme="dark"] .brand-light { display: none; }
.hero-logo { height: 122px; width: auto; max-width: 100%; }
@media (min-width: 768px) { .hero-logo { height: 163px; } }
.hero { background: var(--aii-cream); }
[data-bs-theme="dark"] .hero { background: #1b2540; }
.info-btn { color: var(--aii-gold); min-height: var(--aii-touch); min-width: var(--aii-touch); justify-content: center; }
.emblem-large { height: 140px; width: auto; }
.emblem-parts dt { font-weight: 600; margin-top: .75rem; }
.emblem-parts dt .fa-solid { width: 1.4rem; }
.emblem-parts dd { margin-bottom: 0; }
.sidebar-link.active { box-shadow: inset 3px 0 0 var(--aii-gold); }
html { scroll-padding-top: 4.5rem; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 2000; }
.skip-link:focus { left: .5rem; }
.navbar-brand img { height: 32px; width: auto; }
.btn, .form-control, .form-select { min-height: var(--aii-touch); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn.dropdown-toggle::after { margin-left: .1rem; }
.btn-sm, .btn-group-sm > .btn { min-height: 34px; }
.icon-btn { display: inline-flex; align-items: center; gap: .4rem; }
.badge .fa-solid, .badge .fa-regular { margin-right: .25rem; }
.card { border-radius: var(--aii-radius); }
.stat { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.hero { background: var(--aii-muted-bg); border-radius: var(--aii-radius); padding: 1.5rem; }
@media (min-width: 992px) { .hero { padding: 3rem; } }

/* layout: sidebar on lg+, offcanvas on small screens */
.app-shell { display: flex; gap: 1.5rem; }
.app-sidebar { display: none; }
@media (min-width: 992px) {
  .app-sidebar { display: block; flex: 0 0 var(--aii-sidebar); position: sticky; top: 4.5rem; align-self: flex-start; }
  .app-content { flex: 1 1 auto; min-width: 0; }
}
.sidebar-link { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: .5rem; color: inherit; text-decoration: none; min-height: var(--aii-touch); }
.sidebar-link:hover, .sidebar-link.active { background: var(--aii-muted-bg); }
.sidebar-link .fa-solid { width: 1.25rem; text-align: center; }

/* responsive tables: cards on xs/sm */
@media (max-width: 767.98px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border: 1px solid var(--bs-border-color); border-radius: var(--aii-radius); margin-bottom: .75rem; padding: .5rem .75rem; }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem 0; }
  .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--bs-secondary-color); flex: 0 0 40%; }
  .table-cards td.td-actions { justify-content: flex-end; }
  .table-cards td.td-actions::before { display: none; }
}

/* forms */
.field-label { font-weight: 600; }
.field-required::after { content: " *"; color: var(--bs-danger); }
.field-help { font-size: .9rem; color: var(--bs-secondary-color); }
.help-panel { border-left: 3px solid var(--aii-primary); background: var(--aii-muted-bg); padding: .6rem .8rem; border-radius: .25rem; margin-top: .4rem; }
.help-ref { font-size: .8rem; color: var(--bs-secondary-color); }
.snippet-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.snippet-list .btn { white-space: normal; text-align: left; }
.public-toggle { display: inline-flex; align-items: center; gap: .4rem; margin-top: .3rem; }
.section-card { margin-bottom: 1.25rem; }
.section-card .card-header { font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.action-bar { position: sticky; bottom: 0; z-index: 1020; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color); padding: .75rem 0; margin-top: 1rem; }
.action-bar .btn { margin-bottom: .25rem; }
.custom-field-row { border: 1px dashed var(--bs-border-color); border-radius: .5rem; padding: .75rem; margin-bottom: .75rem; }
.wizard-progress .step { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.wizard-nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.wizard-nav a { flex: 1 1 calc(25% - .5rem); min-width: 7rem; }
@media (min-width: 992px) { .wizard-nav a { flex: 1 1 auto; } }
.dl-grid { display: grid; grid-template-columns: 1fr; gap: .25rem 1rem; }
@media (min-width: 768px) { .dl-grid { grid-template-columns: minmax(12rem, 1fr) 2fr; } }
.dl-grid dt { color: var(--bs-secondary-color); font-weight: 500; }
.dl-grid dd { margin: 0 0 .5rem 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (min-width: 768px) { .dl-grid dd { margin-bottom: .25rem; } }
.risk-PROHIBITED { background: #842029 !important; }
.risk-HIGH_RISK { background: #dc3545 !important; }
.risk-TRANSPARENCY_OBLIGATION { background: #fd7e14 !important; }
.risk-MINIMAL { background: #198754 !important; }
.risk-UNDER_REVIEW { background: #6c757d !important; }
.state-DRAFT { background: #6c757d !important; }
.state-PUBLISHED { background: #198754 !important; }
.state-WITHDRAWN { background: #fd7e14 !important; }
/* explicit height + auto width: SVG logos without width/height attributes otherwise contribute 0 to the
   intrinsic width of their flex container (the border then wraps only the image, not the name) */
.tenant-logo { height: 48px; width: auto; max-width: 160px; object-fit: contain; flex: 0 0 auto; }
.tenant-logo-lg { height: 96px; width: auto; max-width: 240px; object-fit: contain; }
/* home tenant tile: one feature-card wide; long names wrap inside the border instead of overflowing */
.tenant-tile { height: 132px; padding: .75rem !important; text-align: center; }
/* logo fills the tile height but never exceeds the tile width; object-fit keeps the aspect ratio */
.tenant-tile .tenant-logo { height: 100%; width: auto; max-width: 100%; min-width: 0; flex: 0 1 auto; object-fit: contain; }
/* with the name next to it the logo takes at most 60 % of the width */
.tenant-tile.with-name .tenant-logo { height: 72px; max-width: 60%; }
.tenant-tile > span { min-width: 0; overflow-wrap: anywhere; }
footer { font-size: .9rem; }
.pw-box { font-family: var(--bs-font-monospace); font-size: 1.25rem; letter-spacing: .05em; user-select: all; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.container-xxl { max-width: 1400px; }
/* export format buttons: equal width regardless of label */
.format-buttons .btn { flex: 1 1 0; min-width: 5rem; max-width: 8rem; text-align: center; }
/* action cells: keep buttons on one line */
.td-actions { white-space: nowrap; width: 1%; }
.td-actions form { display: inline-block; }
.td-actions .btn + .btn, .td-actions form + .btn, .td-actions .btn + form, .td-actions form + form { margin-left: .25rem; }

/* home: legal framework tile (label left, DE/EN buttons right; buttons never wrap apart) */
.ref-links-group { margin-bottom: .4rem; padding-bottom: .3rem; border-bottom: 1px solid var(--bs-border-color); }
.ref-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .3rem 0; }
.ref-link + .ref-link { border-top: 1px dashed var(--bs-border-color-translucent); }
.ref-link-label { font-size: .9rem; line-height: 1.3; }
.ref-link-langs { display: inline-flex; gap: .35rem; flex: 0 0 auto; }
.ref-link-langs .btn { min-width: 2.75rem; justify-content: center; font-weight: 600; }
@media (min-width: 1200px) { .ref-links { position: sticky; top: 5rem; } }

/* tenant logo previews in the tenant settings: always on neutral grey (independent of the theme), so transparent
   areas are visible for both the regular and the dark-theme logo (white or dark artwork stays recognisable) */
.logo-preview-light, .logo-preview-dark { display: inline-flex; padding: .5rem; border-radius: .5rem; border: 1px solid var(--bs-border-color); background: #808080; }

/* sidebar: name of the selected tenant under the "Tenant" heading; long names are truncated (full name in title) */
.nav-current-tenant { margin-top: -.15rem; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
