/* ------------------------------------------------------------------
   InstArc brand theme — Bootstrap 5 overrides.

   Two brand colours, from the InstArc wordmark:
     charcoal  structure and action — chrome, headings, the active nav
               pill, the avatar, primary buttons (white label, 14:1)
     red       danger — errors and destructive actions, and nothing else

   Red is kept off primary buttons on purpose: if the everyday action and
   the destructive one share a colour, the colour stops meaning anything.
   The logo carries the brand red; the interface uses it only as a warning.
   ------------------------------------------------------------------ */

:root {
    --ia-charcoal: #2b2b2b;
    --ia-action: #2b2b2b;
    --ia-action-dark: #111111;
    --ia-red: #c00000;

    /* Retained name: the whole sheet refers to the structural colour as --ia-dark. */
    --ia-dark: var(--ia-charcoal);

    --ia-bg: #f5f5f9;
    --ia-surface: #ffffff;
    --ia-border: #e6e6ea;
    --ia-text: #5d596c;
    --ia-muted: #a7a4b1;

    --ia-sidebar-width: 260px;
    /* The top bar's height, which the logo area matches so their lines meet. */
    --ia-topbar-height: 60px;
    --ia-radius: 0.5rem;
    --ia-shadow: 0 2px 6px rgba(67, 89, 113, 0.08);
    --ia-shadow-lg: 0 4px 18px rgba(67, 89, 113, 0.12);

    /* Text on a --ia-dark / --ia-action fill (the active nav pill, the avatar, primary buttons). */
    --ia-on-dark: #ffffff;
    /* Red as text (warnings, danger badges and alerts), apart from red as a fill: on a dark
       ground the brand red is too dim to read as text, but stays right behind a white label. */
    --ia-red-text: var(--ia-red);
    --ia-focus-ring: rgba(43, 43, 43, 0.35);
    --ia-focus-ring-soft: rgba(43, 43, 43, 0.2);
    --ia-head-bg: #fcfcfd;
    /* A card's title bar: a light grey, a step darker than the table head. */
    --ia-card-head-bg: #f4f4f7;
    /* The edge drawn round a flag, so a white one still has an edge on a white row. */
    --ia-hairline: rgba(0, 0, 0, 0.08);
    --ia-secret-bg: #fffdf7;
    /* A sandbox tenant (its row in the tenant list, its profile bar): the top bar's environment
       tape's stripes, without its fade: light grey bands, see-through between them. */
    --ia-sandbox-stripe: #f8f8fa;
    /* Scrollbars: a slim thumb on no track, darker under the pointer. */
    --ia-scrollbar-thumb: rgba(43, 43, 43, 0.22);
    --ia-scrollbar-thumb-hover: rgba(43, 43, 43, 0.4);
    --ia-sandbox-stripes: repeating-linear-gradient(-45deg, var(--ia-sandbox-stripe) 0 0.75rem, transparent 0.75rem 1.5rem);
    /* Support tickets: an internal note's warm shading, the requester's own messages' accent, and the timeline's line. */
    --ia-note-bg: #fffaf0;
    --ia-note-border: #f1dcaa;
    --ia-requester: #2f6fbf;
    --ia-timeline-line: #e3e3e9;
    /* Charts: two categorical series (validated), the sparkline's de-emphasis grey and its current point. */
    --ia-chart-series-1: #2a78d6;
    --ia-chart-series-2: #eb6834;
    --ia-sparkline: #c4c3cc;
    --ia-sparkline-point: #2b2b2b;
}

/* ---------------------------------------------------------- dark mode

   Chosen with the top bar's button (Navigation/Theme.cs) and set as data-bs-theme on <html>,
   which also switches Bootstrap's own components. The same two-colour rule holds, inverted:
   the structural colour becomes a light grey, so headings and the active pill stay the
   strongest thing on the page and primary buttons become light with a charcoal label.
   Red still means danger only. Neutral greys, not Bootstrap's blue-tinted dark. */
[data-bs-theme="dark"] {
    --ia-charcoal: #ececf1;
    --ia-action: #ececf1;
    --ia-action-dark: #ffffff;
    --ia-on-dark: #1c1c20;
    --ia-red-text: #ff7b7b;

    --ia-bg: #17171b;
    --ia-surface: #212126;
    --ia-border: #34343c;
    --ia-text: #b9b7c4;
    --ia-muted: #86848f;

    --ia-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    --ia-shadow-lg: 0 4px 18px rgba(0, 0, 0, 0.5);
    --ia-focus-ring: rgba(236, 236, 241, 0.4);
    --ia-focus-ring-soft: rgba(236, 236, 241, 0.25);
    --ia-head-bg: #26262c;
    --ia-card-head-bg: #29292f;
    --ia-hairline: rgba(255, 255, 255, 0.14);
    --ia-secret-bg: #2a2820;
    /* The sandbox stripes' grey on dark: a shade lighter than the card, not light grey. */
    --ia-sandbox-stripe: #2c2c33;
    --ia-scrollbar-thumb: rgba(236, 236, 241, 0.2);
    --ia-scrollbar-thumb-hover: rgba(236, 236, 241, 0.38);
    --ia-note-bg: #2a2820;
    --ia-note-border: rgba(245, 180, 40, 0.3);
    --ia-requester: #8ab8f0;
    --ia-timeline-line: #34343c;
    --ia-chart-series-1: #3987e5;
    --ia-chart-series-2: #d95926;
    --ia-sparkline: #55555e;
    --ia-sparkline-point: #ececf1;

    /* Bootstrap's components (inputs, dropdowns, modals, tables) take these. */
    --bs-body-bg: var(--ia-surface);
    --bs-body-color: var(--ia-text);
    --bs-emphasis-color: var(--ia-charcoal);
    --bs-border-color: var(--ia-border);
    --bs-secondary-bg: #2a2a30;
    --bs-tertiary-bg: #26262c;
    color-scheme: dark;
}

/* The ticks and dots Bootstrap draws in a ticked box are white; on the light fill dark mode
   gives a ticked box they would vanish, so they are drawn in the label colour instead. */
[data-bs-theme="dark"] .form-check-input:checked[type=checkbox] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231c1c20' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .form-check-input:checked[type=radio] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%231c1c20'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231c1c20'/%3e%3c/svg%3e");
}

/* One logo per theme (Views/Shared/_Brand.cshtml). The usual one stays if the dark one is missing. */
.ia-brand-logo.ia-logo-for-dark,
[data-bs-theme="dark"] .ia-brand-logo.ia-logo-for-light:has(+ .ia-logo-for-dark) {
    display: none;
}

[data-bs-theme="dark"] .ia-brand-logo.ia-logo-for-dark {
    display: block;
}

/* The top bar's mode button shows the mode you would switch to. */
.ia-theme-icon-light,
[data-bs-theme="dark"] .ia-theme-icon-dark {
    display: none;
}

[data-bs-theme="dark"] .ia-theme-icon-light {
    display: inline;
}

html, body {
    height: 100%;
}

/* The scale of the whole console: every size here and in Bootstrap is in rem, so this one
   value sizes all of it. A pixel under the browser's usual 16px. */
html {
    font-size: 15px;
}

body {
    font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background-color: var(--ia-bg);
    color: var(--ia-text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ia-dark);
    font-weight: 600;
}

a {
    color: var(--ia-dark);
    text-decoration: none;
}

a:hover {
    color: var(--ia-charcoal);
    text-decoration: underline;
}

.text-muted-soft {
    color: var(--ia-muted) !important;
}

/* ---------------------------------------------------------- app shell */

.ia-shell {
    min-height: 100vh;
}

.ia-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ia-sidebar-width);
    background: var(--ia-surface);
    border-right: 1px solid var(--ia-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1030;
}

/* Everything under the logo: the menu, and the usage box held to the bottom. It scrolls, the
   logo above it does not. */
.ia-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The content column is exactly the window's height: the top bar at its top, holding its place,
   and the page under it, which scrolls on its own, as the menu does under the logo. So the bar
   spans the column's full width and the page's scrollbar starts below it. */
.ia-content {
    margin-left: var(--ia-sidebar-width);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The topbar spans the full content column, so page padding lives here instead. It is the
   scrolling area: sticky parts in it (a contents card, the form builder's components) are kept
   from its top, not the window's. */
.ia-page {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 1.5rem 2.5rem;
}

/* ---------------------------------------------------------- brand */

/* The logo area: exactly the top bar's height, with the same line under it, so the two read
   as one band across the top. */
.ia-brand {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    height: var(--ia-topbar-height);
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-dark);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.ia-brand,
.ia-brand:hover {
    color: var(--ia-dark);
    text-decoration: none;
}

/* Real artwork, when present. Height-constrained so any aspect ratio fits. */
.ia-brand-logo {
    height: 32px;
    width: auto;
    max-width: 100%;
    display: block;
}

.ia-brand-logo-auth {
    height: 48px;
    margin: 0 auto;
}

.ia-brand-mark {
    height: 32px;
    width: auto;
    flex: 0 0 auto;
}

.ia-brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    background: var(--ia-dark);
    color: var(--ia-on-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

/* ---------------------------------------------------------- sidebar nav */

.ia-nav {
    padding: 0.75rem 0.75rem 1.5rem;
    margin: 0;
    list-style: none;
}

.ia-nav-header {
    padding: 1.25rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ia-muted);
}

.ia-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.125rem;
    border-radius: 2rem;
    color: var(--ia-text);
    font-size: 0.9375rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ia-nav-link,
.ia-nav-link:hover,
.ia-nav-link:focus {
    text-decoration: none;
}

.ia-nav-link:hover {
    background: var(--ia-bg);
    color: var(--ia-dark);
}

/* A placeholder entry for a screen not built yet (Soon in _SidebarNav): no hover, no pointer. */
.ia-nav-link.ia-nav-soon,
.ia-nav-link.ia-nav-soon:hover {
    background: none;
    color: var(--ia-muted);
    cursor: default;
}

.ia-nav-soon .badge {
    font-size: 0.625rem;
    font-weight: 500;
}

.ia-nav-link.active {
    background: var(--ia-dark);
    color: var(--ia-on-dark);
    font-weight: 500;
}

.ia-nav-link.active:hover {
    background: var(--ia-dark);
    color: var(--ia-on-dark);
}

.ia-nav-link i {
    font-size: 1.0625rem;
    line-height: 1;
}

/* A parent row is a disclosure control, not a destination: it never takes the
   dark active pill, since the pill marks the page you are actually on. */
.ia-nav-parent .ia-nav-caret {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.ia-nav-parent.collapsed .ia-nav-caret {
    transform: rotate(-90deg);
}

.ia-nav-parent[aria-expanded="true"] {
    color: var(--ia-charcoal);
    font-weight: 500;
}

.ia-nav-sub {
    list-style: none;
    margin: 0.125rem 0 0.25rem;
    padding-left: 1.25rem;
}

.ia-nav-sub .ia-nav-link {
    padding-left: 0.75rem;
    font-size: 0.9063rem;
}

/* A dot in front of every sub item, drawn here so no entry can be added without one.
   currentColor, so it turns white with the text on the active pill. */
.ia-nav-sub .ia-nav-link::before {
    content: "";
    flex: none;
    width: 0.3125rem;
    height: 0.3125rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.ia-nav-sub .ia-nav-link.active::before {
    opacity: 1;
}

/* A group nested inside a group indents a little less than the first level. */
.ia-nav-sub .ia-nav-sub {
    padding-left: 0.75rem;
}

/* The client's standing position, pinned to the foot of the sidebar. The nav above
   takes the slack so this sits at the bottom however short the menu is. */
.ia-nav {
    flex: 1 1 auto;
}

.ia-usage {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 0.875rem 1.5rem 1.125rem;
    border-top: 1px solid var(--ia-border);
    background: var(--ia-surface);
}

.ia-usage-header {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ia-muted);
    margin-bottom: 0.5rem;
}

.ia-usage-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--ia-text);
    padding: 0.1875rem 0;
}

.ia-usage-figure {
    font-weight: 600;
    color: var(--ia-dark);
    font-variant-numeric: tabular-nums;
}

.ia-usage-warning {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--ia-red-text);
}

/* ---------------------------------------------------------- floating navbar */

/* A light bar: the console is an internal tool, and a dark bar is better kept for a
   client-facing product if one is added to the platform.

   Flush to the top and to both edges of the content column: no margin, and square
   corners, since a rounded bar against the viewport edge reads as a rendering fault.
   White ground, so nothing inverts: charcoal title, muted controls that darken to
   charcoal on hover, and the ordinary charcoal avatar disc. */
/* The top bar holds its place at the top of the content column; the page scrolls under it
   (.ia-page). Above the page, so its dropdowns open over it. */
.ia-topbar {
    position: relative;
    z-index: 1020;
    flex: none;
    background: var(--ia-surface);
    border-bottom: 1px solid var(--ia-border);
    border-radius: 0;
    box-shadow: var(--ia-shadow);
    padding: 0.625rem 1.5rem;
    margin: 0;
    height: var(--ia-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--ia-dark);
}

/* An icon button in the top bar (the light / dark mode switch), as tall as the avatar beside it. */
.ia-topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: transparent;
    color: var(--ia-text);
    font-size: 1.0625rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ia-topbar-icon:hover {
    background: var(--ia-bg);
    color: var(--ia-dark);
}

.ia-topbar-icon:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem var(--ia-focus-ring);
}

/* No .ia-topbar .ia-avatar override: the base charcoal-on-white disc is what belongs on
   a light bar. */

.ia-topbar .btn-link,
.ia-topbar .dropdown-toggle {
    color: var(--ia-text);
}

.ia-topbar .btn-link:hover,
.ia-topbar .dropdown-toggle:hover {
    color: var(--ia-dark);
}

/* The environment name in the top bar (DEVELOPMENT, STAGING; nothing in production), as a
   strip of crime-scene tape: light grey and yellow stripes at 45 degrees that fade out to the right,
   with the name printed on them at its start.
   Loud on purpose: it is there so a test console is never taken for the real one. */
.ia-env-tape {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    padding: 0 4rem 0 0;
    user-select: none;
}

/* The stripes are a layer of their own, so only they are faded and see-through: the name
   printed on them stays solid. */
.ia-env-tape::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(-45deg, #f5c400 0 0.75rem, #c8c8c8 0.75rem 1.5rem);
    -webkit-mask-image: linear-gradient(to right, #000 55%, transparent);
    mask-image: linear-gradient(to right, #000 55%, transparent);
    opacity: 0.5;
}

/* Edge to edge with the bar: its full height, and from its very start. On narrow screens the
   menu button comes first, so the tape only reaches the bar's start on wide ones. */
.ia-topbar .ia-env-tape {
    margin: -0.625rem 0;
}

@media (min-width: 992px) {
    .ia-topbar .ia-env-tape {
        margin-left: -1.5rem;
    }
}

/* The name sits right on the stripes, solid. Black letters with a yellow halo, so they read
   where they cross a light grey stripe as well as a yellow one. */
.ia-env-tape-label {
    padding: 0 0.75rem;
    color: #111;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    text-shadow:
        0 0 2px #f5c400, 0 0 2px #f5c400, 0 0 3px #f5c400,
        1px 1px 0 #f5c400, -1px -1px 0 #f5c400, 1px -1px 0 #f5c400, -1px 1px 0 #f5c400;
}

/* A person's picture, or their initials: a rounded square, never a circle, here and on
   their profile alike. */
.ia-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--ia-radius);
    background: var(--ia-dark);
    color: var(--ia-on-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ia-topbar .dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-lg);
    font-size: 0.9375rem;
}

/* ---------------------------------------------------------- cards */

.card {
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow);
}

.card-header {
    /* Through Bootstrap's own variables, so header tabs (.card-header-tabs), which offset
       themselves by these, sit on the header's bottom border instead of above it. */
    --bs-card-cap-padding-y: 1rem;
    --bs-card-cap-padding-x: 1.25rem;
    background: var(--ia-card-head-bg);
    border-bottom: 1px solid var(--ia-border);
    padding: var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);
    font-weight: 600;
    color: var(--ia-dark);
}

/* A button in a card's title bar (Edit, Client sharing): smaller than an ordinary small button,
   and pulled into the bar's padding, so a bar with buttons is as tall as one without. */
.card-header .btn-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: -0.25rem 0;
}

.card-header .btn-sm .badge {
    font-size: 0.6875rem;
    padding: 0.15em 0.45em;
}

.card-body {
    /* A variable so something inside can reach the card's edges by undoing exactly this. */
    --ia-card-pad: 1.25rem;
    padding: var(--ia-card-pad);
}

.ia-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ia-dark);
    line-height: 1.2;
}

.ia-stat-label {
    font-size: 0.8125rem;
    color: var(--ia-muted);
}

/* A revealed secret needs to look like something you should not leave on screen. */
.ia-secret-card {
    border-color: var(--ia-action);
    background: var(--ia-secret-bg);
}

.ia-secret {
    font-size: 1rem;
    padding: 0.625rem 0.75rem;
    background: var(--ia-bg);
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-dark);
    word-break: break-all;
    user-select: all;
}

/* ---------------------------------------------------------- tables */

.table {
    color: var(--ia-text);
    margin-bottom: 0;
}

.table > thead > tr > th {
    background: var(--ia-head-bg);
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    border-bottom: 1px solid var(--ia-border);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* List tables: the first column (what the row is) reads from the left, the last (its buttons)
   sits at the right, and every column between them is centred, whatever its cells ask for. A
   flag column does not count as the first: the name after it still reads from the left. Only
   tables in a .table-responsive, which is every list; small tables inside forms keep their own. */
.table-responsive > .table > thead > tr > th:not(:first-child):not(:last-child),
.table-responsive > .table > tbody > tr > td:not(:first-child):not(:last-child) {
    text-align: center !important;
}

.table-responsive > .table > thead > tr > .ia-flag-cell + th,
.table-responsive > .table > tbody > tr > .ia-flag-cell + td {
    text-align: left !important;
}

/* A middle column that is read as text rather than scanned (the activity log's Activity) opts out
   of the centring with .ia-cell-start on its header and cells. As specific as the rule above it
   and later, so it wins. */
.table-responsive > .table > thead > tr > th.ia-cell-start:not(:first-child),
.table-responsive > .table > tbody > tr > td.ia-cell-start:not(:first-child) {
    text-align: left !important;
}

/* For a table that should fit on one screen rather than breathe. */
.table-compact > thead > tr > th,
.table-compact > tbody > tr > td {
    padding: 0.4rem 0.75rem;
}

.table-compact .btn-sm {
    font-size: 0.75rem;
    line-height: 1.25;
    padding: 0.2rem 0.5rem;
}

/* Fills the row and truncates: max-width 0 is what lets a table cell shrink below its content. */
.ia-cell-fill {
    max-width: 0;
    min-width: 12rem;
    width: 100%;
}

/* ---------------------------------------------------------- list paging

   Every list's table card opens with a toolbar: the page size at the left (_TablePageSize.cshtml),
   and at the right the list's filter form: its filters, the search box (_TableSearch.cshtml), Search
   and Clear. It closes with the pager (_TablePager.cshtml): which rows these are at the left,
   Previous, the page numbers and Next at the right. */
.ia-table-toolbar,
.ia-table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.75rem 1rem;
}

.ia-table-toolbar {
    border-bottom: 1px solid var(--ia-border);
}

.ia-table-footer {
    border-top: 1px solid var(--ia-border);
}

/* Rows per page: as wide as its number, not the full width a select takes by default. */
.form-select.ia-table-size {
    width: auto;
}

/* The filter form: filters, search, Search, Clear, in one row pushed to the right. Not allowed to
   shrink, so when it does not fit beside the page size it moves to a line of its own as a whole,
   and wraps (right-aligned) only when even a whole line is too narrow. Filters are only as wide
   as their longest choice. */
.ia-table-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: none;
    max-width: 100%;
    margin-left: auto;
}

.ia-table-filters > .form-select {
    width: auto;
    max-width: 14rem;
}

.ia-table-filters > .btn {
    flex: none;
}

/* A searchable select (site.js, <select data-searchable>): the button wears the select's own
   classes, so it looks like the select it replaces; the menu is a Bootstrap dropdown with a
   search box over a scrolling list of the options. */
.ia-search-select-toggle {
    display: block;
    width: 100%;
    text-align: left;
}

.ia-search-select-text {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* As wide as its longest option (a country name on one line), never narrower than the
   button, and never wider than the screen. */
.ia-search-select-menu {
    width: max-content;
    min-width: max(100%, 16rem);
    max-width: min(32rem, calc(100vw - 2rem));
    padding-top: 0;
}

.ia-search-select-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-search-select-list {
    max-height: 16rem;
    overflow-y: auto;
    padding-top: 0.25rem;
}

.ia-search-select-list .dropdown-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-table-filters > .ia-search-select {
    flex: none;
}

.ia-table-filters > .ia-search-select > .ia-search-select-toggle {
    width: auto;
    min-width: 11rem;
    max-width: 18rem;
}

.ia-table-filter-date {
    width: auto;
    flex-wrap: nowrap;
}

.ia-table-filter-date > .form-control,
.ia-table-filter-date > .input-group-text {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* The search box, with its magnifier laid inside the input's left edge. */
/* A fixed width, not a flexible one: a flexible basis makes the browser size the form a little
   narrower than its contents, and its last button then wraps alone. */
.ia-table-search {
    position: relative;
    flex: none;
    width: 16rem;
    max-width: 100%;
}

/* Narrower on mid-size screens, so the busiest toolbar (users: three filters) still fits a line. */
@media (max-width: 1399.98px) {
    .ia-table-search {
        width: 12rem;
    }
}

.ia-table-search .bi {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: var(--ia-muted);
    pointer-events: none;
}

.ia-table-search .form-control {
    padding-left: 2.125rem;
}

/* Bootstrap's pagination in the console's colours, through its own variables: the current page
   takes the structural fill, like the active nav pill, instead of Bootstrap's blue. */
.pagination {
    --bs-pagination-color: var(--ia-text);
    --bs-pagination-bg: var(--ia-surface);
    --bs-pagination-border-color: var(--ia-border);
    --bs-pagination-hover-color: var(--ia-dark);
    --bs-pagination-hover-bg: var(--ia-bg);
    --bs-pagination-hover-border-color: var(--ia-border);
    --bs-pagination-focus-color: var(--ia-dark);
    --bs-pagination-focus-bg: var(--ia-bg);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem var(--ia-focus-ring);
    --bs-pagination-active-color: var(--ia-on-dark);
    --bs-pagination-active-bg: var(--ia-dark);
    --bs-pagination-active-border-color: var(--ia-dark);
    --bs-pagination-disabled-color: var(--ia-muted);
    --bs-pagination-disabled-bg: var(--ia-surface);
    --bs-pagination-disabled-border-color: var(--ia-border);
    --bs-pagination-border-radius: 0.375rem;
    --bs-pagination-font-size: 0.875rem;
}

.pagination-sm {
    --bs-pagination-padding-x: 0.625rem;
    --bs-pagination-padding-y: 0.3125rem;
    --bs-pagination-font-size: 0.8125rem;
}

.page-link {
    min-width: 2.125rem;
    text-align: center;
    text-decoration: none !important;
    font-variant-numeric: tabular-nums;
}

/* A country in a list (Views/Shared/_CountryName.cshtml): the flag beside the name, the official
   name muted under it. Inline, so a centred column centres the pair, with the text read from the
   left within it. Never wrapped: a long title elsewhere in the row would otherwise squeeze the
   country onto a word a line. */
.ia-country {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-align: left;
    white-space: nowrap;
}

.ia-country .ia-flag {
    width: 1.75rem;
    height: 1.3125rem;
}

/* A list where the country is a row's main fact (the tenant list): a bigger flag, beside two lines. */
.ia-country.ia-country-lg .ia-flag {
    width: 2.5rem;
    height: 1.875rem;
}

/* A menu entry with a count at its far end (a module's configuration pages). */
.dropdown-item.ia-menu-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 13rem;
}

.dropdown-item.ia-menu-count .badge {
    margin-left: auto;
}

/* Tabs across a page with several parts and one sidebar entry (the Ledger page): an underline
   in the structural colour marks the current one, as the active nav pill does in the sidebar. */
.ia-page-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-page-tabs .nav-link {
    margin-bottom: -1px;
    padding: 0.5rem 0.875rem;
    border-bottom: 2px solid transparent;
    color: var(--ia-text);
    text-decoration: none;
}

.ia-page-tabs .nav-link:hover {
    color: var(--ia-dark);
}

.ia-page-tabs .nav-link.active {
    border-bottom-color: var(--ia-dark);
    color: var(--ia-dark);
    font-weight: 500;
}

/* Pill tabs across a page (a tenant's Overview and Branding, _TenantTabs): Bootstrap's
   nav-pills in the console's colours. The current one takes the structural fill, as the active
   nav pill does in the sidebar; the others are muted text that darkens on hover. */
.ia-page-pills {
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ia-page-pills .nav-link {
    padding: 0.4375rem 0.875rem;
    border-radius: var(--ia-radius);
    color: var(--ia-text);
    text-decoration: none;
}

.ia-page-pills .nav-link:hover {
    background: var(--ia-hairline);
    color: var(--ia-dark);
}

.ia-page-pills .nav-link.active {
    background: var(--ia-dark);
    color: var(--ia-on-dark);
    font-weight: 500;
}

/* The Ledger's How it works tab (Views/Ledger/Index.cshtml): sections the contents card links to
   land below the top bar, the contents card sticks below it, and the flow diagram is drawn in the
   theme's colours so it follows dark mode. */
.ia-ledger-toc {
    top: 1rem;
}

/* The contents links in the console's text colours, not Bootstrap's link blue. */
.ia-ledger-toc .nav-link {
    color: var(--ia-text);
}

.ia-ledger-toc .nav-link:hover,
.ia-ledger-toc .nav-link:focus {
    color: var(--ia-dark);
}

.ia-ledger-section {
    scroll-margin-top: 1rem;
}

.ia-ledger-flow {
    width: 100%;
    height: auto;
    max-width: 980px;
}

.ia-ledger-flow .box {
    fill: var(--ia-surface);
    stroke: var(--ia-border);
    stroke-width: 1.5;
}

.ia-ledger-flow .box.accent {
    stroke: var(--ia-dark);
    stroke-width: 2;
}

.ia-ledger-flow text {
    fill: var(--ia-text);
    font-size: 13px;
}

.ia-ledger-flow .title {
    fill: var(--ia-dark);
    font-weight: 600;
}

.ia-ledger-flow .muted {
    fill: var(--ia-muted);
    font-size: 11.5px;
}

.ia-ledger-flow .arrow {
    stroke: var(--ia-muted);
    stroke-width: 1.5;
    fill: none;
    marker-end: url(#ia-ledger-arrow);
}

.ia-ledger-flow .arrow-head {
    fill: var(--ia-muted);
}

.ia-ledger-flow .zone {
    fill: none;
    stroke: var(--ia-border);
    stroke-dasharray: 5 4;
}

/* ---------------------------------------------------------- buttons */

.btn {
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    padding: 0.4375rem 1rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;

    /* Pressed, every button flashes InstArc red instead of Bootstrap's blue. Through Bootstrap's
       own variables, which its :active and .active rules read; set here, after Bootstrap's
       per-variant values, so they win for every variant. */
    --bs-btn-active-bg: var(--ia-red);
    --bs-btn-active-border-color: var(--ia-red);
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 192, 0, 0;
}

/* The rule above sets the size outright, which overrides Bootstrap's btn-sm variables; so the
   small size is set outright too. */
.btn-sm {
    border-radius: 0.3rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0.625rem;
}

.btn-primary {
    background-color: var(--ia-action);
    border-color: var(--ia-action);
    color: var(--ia-on-dark);
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ia-action-dark);
    border-color: var(--ia-action-dark);
    color: var(--ia-on-dark);
}

/* Disabled, a primary button keeps its own colour, faded, instead of Bootstrap's blue. */
.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--ia-action);
    border-color: var(--ia-action);
    color: var(--ia-on-dark);
    opacity: 0.5;
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem var(--ia-focus-ring);
}

/* Destructive actions get the third brand colour, and only they do. */
.btn-danger {
    background-color: var(--ia-red);
    border-color: var(--ia-red);
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger:first-child:active {
    background-color: #a80000;
    border-color: #a80000;
    color: #fff;
}

/* The primary colour as an outline, on the card's own white so it stands out on a grey title
   bar (Details' Edit and Client sharing); filled on hover, as a primary button. */
.btn-outline-primary {
    background-color: var(--ia-surface);
    border-color: var(--ia-action);
    color: var(--ia-action);
    font-weight: 500;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--ia-action);
    border-color: var(--ia-action);
    color: var(--ia-on-dark);
}

.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem var(--ia-focus-ring);
}

.btn-outline-secondary {
    border-color: var(--ia-border);
    color: var(--ia-text);
}

.btn-outline-secondary:hover {
    background-color: var(--ia-bg);
    border-color: var(--ia-border);
    color: var(--ia-dark);
}

.btn-link {
    color: var(--ia-charcoal);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--ia-charcoal);
    text-decoration: underline;
}

/* ---------------------------------------------------------- forms */

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ia-dark);
    margin-bottom: 0.3125rem;
}

.form-control,
.form-select {
    border-color: var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-text);
    font-size: 0.9375rem;
    padding: 0.4375rem 0.75rem;
}

/* The shorthand above also takes away Bootstrap's room for a select's arrow; give it back, or a
   long choice runs under the arrow. */
.form-select {
    padding-right: 2.25rem;
}

/* Small inputs (a list's toolbar: rows per page, filters, search) are exactly as tall as a small
   button beside them: the same text size, line height and vertical padding as .btn-sm. */
.form-control-sm,
.form-select-sm {
    border-radius: 0.3rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.form-control-sm {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
}

.form-select-sm {
    padding-left: 0.625rem;
    padding-right: 2rem;
    background-position: right 0.625rem center;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ia-action);
    box-shadow: 0 0 0 0.15rem var(--ia-focus-ring-soft);
}

.form-check-input:checked {
    background-color: var(--ia-dark);
    border-color: var(--ia-dark);
}

.form-text,
.text-danger {
    font-size: 0.8125rem;
}

/* ---------------------------------------------------------- badges & alerts */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-soft-success { background: #e8f5ee; color: #1f7a4d; }
.badge-soft-danger  { background: #fdeaea; color: var(--ia-red-text); }
.badge-soft-gold    { background: #fdf3e0; color: #7a5601; }
.badge-soft-muted   { background: var(--ia-bg); color: var(--ia-muted); }
.badge-soft-dark    { background: #ececec; color: var(--ia-charcoal); }
.badge-soft-info    { background: #e7f0fb; color: #1d5fa8; }

[data-bs-theme="dark"] .badge-soft-success { background: rgba(46, 160, 103, 0.18); color: #74d6a4; }
[data-bs-theme="dark"] .badge-soft-danger  { background: rgba(255, 90, 90, 0.16); }
[data-bs-theme="dark"] .badge-soft-gold    { background: rgba(245, 180, 40, 0.16); color: #f0c46a; }
[data-bs-theme="dark"] .badge-soft-dark    { background: #34343c; }
[data-bs-theme="dark"] .badge-soft-info    { background: rgba(80, 150, 240, 0.16); color: #8ab8f0; }

/* A small heading over a group of cards on a page (the dashboard's Tenants, Management users). */
.ia-section-title {
    margin: 0 0 0.75rem;
    color: var(--ia-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The top of every page (Views/Shared/_PageHeader.cshtml): the title, the breadcrumb under
   it, and the page's buttons at the right end. */
.ia-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.ia-page-title {
    margin: 0 0 0.25rem;
    color: var(--ia-dark);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ia-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ia-muted);
    font-size: 0.8125rem;
}

.ia-breadcrumb li + li::before {
    content: "\203A";
    margin: 0 0.5rem;
    color: var(--ia-muted);
}

.ia-breadcrumb a {
    color: var(--ia-text);
    text-decoration: none;
}

.ia-breadcrumb a:hover {
    color: var(--ia-dark);
    text-decoration: underline;
}

.ia-breadcrumb [aria-current="page"] {
    color: var(--ia-dark);
    font-weight: 500;
}

.ia-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* A page's one-line description, at the top of its content under the header. */
.ia-page-lead {
    margin-bottom: 1rem;
}

/* A user's page (Users/Detail). The profile bar: avatar, then the name with its facts in one
   row under it, then the boxed edit pencil at the far end. */
.ia-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ia-profile-main {
    flex: 1 1 auto;
    min-width: 0;
}

.ia-profile-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 1.25rem;
    color: var(--ia-muted);
    font-size: 0.875rem;
}

.ia-profile-facts i {
    margin-right: 0.375rem;
}

/* The profile picture: square with the console's rounded corners, not the top bar's disc. */
.ia-avatar-lg {
    flex: none;
    width: 4rem;
    height: 4rem;
    border-radius: var(--ia-radius);
    font-size: 1.375rem;
}

.ia-profile > .btn {
    flex: none;
}

/* Splits the profile bar into sections: a hairline from the card's top edge to its bottom,
   reaching through the card's padding so it has no gap above or below. */
.ia-profile-divider {
    flex: none;
    align-self: stretch;
    width: 1px;
    margin: calc(-1 * var(--ia-card-pad)) 0;
    background: var(--ia-border);
}

/* A tenant's environment in its profile bar: an icon and the name on the environment's
   colour (the badge-soft-* class it is given). */
.ia-profile-env {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--ia-radius);
    line-height: 1.2;
}

.ia-profile-env > i {
    font-size: 1.25rem;
}

.ia-profile-env-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

/* A card's label-and-value list laid straight in the card (no .card-body): one row per item,
   hairlines between rows running edge to edge of the card and between label and value running
   the row's full height, so the list reads as a grid (Tenants/Detail's Details). */
.ia-detail-list {
    margin: 0;
    font-size: 0.875rem;
}

.ia-detail-row {
    display: flex;
}

.ia-detail-row + .ia-detail-row {
    border-top: 1px solid var(--ia-border);
}

.ia-detail-row > dt,
.ia-detail-row > dd {
    padding: 0.625rem 1.25rem;
}

.ia-detail-row > dt {
    flex: 0 0 33%;
    font-weight: 400;
    color: var(--ia-muted);
    border-right: 1px solid var(--ia-border);
}

.ia-detail-row > dd {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

/* A row with two values (a colour in light and dark mode): side by side, ruled between. */
.ia-detail-row > dd + dd {
    border-left: 1px solid var(--ia-border);
}

/* The small label over one of a row's two values ("Light", "Dark"): a strip across the top of
   the cell, edge to edge (through the cell's padding), ruled off from the value under it.
   Label and value are centred. */
.ia-detail-sub {
    margin: -0.625rem -1.25rem 0.625rem;
    padding: 0.25rem 1.25rem;
    border-bottom: 1px solid var(--ia-border);
    font-size: 0.75rem;
    color: var(--ia-muted);
    text-align: center;
}

.ia-detail-row > dd:has(> .ia-detail-sub) {
    text-align: center;
}

.ia-detail-row > dd:has(> .ia-detail-sub) > .ia-logo-slot-square {
    margin: 0 auto;
}

/* A second titled section inside a card (a tenant's Branding: Social media under Details):
   a card header in the middle of the card, ruled above as well as below, with no gap. */
.card-header.ia-card-subheader {
    border-top: 1px solid var(--ia-border);
    border-radius: 0;
}

/* A tenant's logo on its Branding tab: drawn on the background it is meant for (white, or
   dark for a dark mode logo), whatever the console's own theme. Empty, it is a dashed upload
   prompt; either way a click opens its crop modal. */
.ia-logo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 3rem;
    padding: 0.25rem;
    border: 1px dashed #d3d3da;
    border-radius: var(--ia-radius);
    background: #ffffff;
    color: #a7a4b1;
    font-size: 0.875rem;
}

.ia-logo-slot-dark {
    border-color: #4a4a54;
    background: #17171b;
    color: #86848f;
}

.ia-logo-slot-set {
    border-style: solid;
}

.ia-logo-slot-square {
    width: 3rem;
}

button.ia-logo-slot:hover,
button.ia-logo-slot:focus-visible {
    border-color: var(--ia-red);
    outline: 0;
}

.ia-logo-slot img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* A colour shown as a small square before its hex (a tenant's branding). */
.ia-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    border: 1px solid var(--ia-hairline);
    border-radius: 0.25rem;
    vertical-align: -0.125rem;
}

/* A tenant's Branding tab: a mock of its application (.ia-bp, "branding preview") in its
   colours, laid out as this console is: a browser tab with the favicon and page title, the logo
   top left, a top bar in the primary colour, a menu whose current item takes the primary
   colour, and a page of sample cards with the accent on links and badges. The colours come in
   as --brand-primary, --brand-accent and the text that reads on each, set on the mock; light
   and dark are the mock's own, whatever the console's theme. */
.ia-bp {
    --bp-bg: #f5f5f9;
    --bp-surface: #ffffff;
    --bp-head: #f4f4f7;
    --bp-border: #e6e6ea;
    --bp-text: #5d596c;
    --bp-strong: #2b2b2b;
    --bp-muted: #a7a4b1;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    overflow: hidden;
    background: var(--bp-bg);
    color: var(--bp-text);
    font-size: 0.75rem;
    line-height: 1.4;
    user-select: none;
}

.ia-bp-dark {
    --bp-bg: #17171b;
    --bp-surface: #212126;
    --bp-head: #29292f;
    --bp-border: #34343c;
    --bp-text: #b9b7c4;
    --bp-strong: #ececf1;
    --bp-muted: #86848f;
}

/* The line between the light and the dark mock: across the whole card, through its padding. */
.ia-bp-divider {
    margin: 0 calc(-1 * var(--ia-card-pad));
    border: 0;
    border-top: 1px solid var(--ia-border);
    opacity: 1;
}

/* The browser: one tab, holding the favicon and the page title, and the window's minimise,
   full screen and close buttons. The same light grey in both mocks: it is the browser, not
   the tenant's application, so it does not follow the application's dark mode. */
.ia-bp-tab {
    display: flex;
    align-items: flex-end;
    padding: 0.375rem 0 0 0.5rem;
    background: #e8e8ed;
}

.ia-bp-window {
    display: flex;
    align-self: center;
    gap: 1.125rem;
    margin-left: auto;
    padding: 0 0.875rem 0.375rem;
    color: #5d596c;
    font-size: 0.75rem;
}

.ia-bp-tab-title {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 16rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.375rem 0.375rem 0 0;
    background: #ffffff;
    color: #2b2b2b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-bp-tab-title img {
    width: 0.875rem;
    height: 0.875rem;
    object-fit: contain;
}

/* The frame: logo and top bar across the top, menu and page under them. */
.ia-bp-app {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    grid-template-rows: 2.75rem auto;
}

.ia-bp-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0 0.75rem;
    border-right: 1px solid var(--bp-border);
    border-bottom: 1px solid var(--bp-border);
    background: var(--bp-surface);
    color: var(--bp-strong);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.ia-bp-brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The horizontal logo fills the logo area as the template's does: its height, up to its width. */
.ia-bp-logo {
    display: block;
    height: 1.5rem;
    max-width: 100%;
    object-fit: contain;
}

.ia-bp-mark {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    object-fit: contain;
}

.ia-bp-mark-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-size: 0.625rem;
}

.ia-bp-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.875rem;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-size: 0.875rem;
}

.ia-bp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    background: var(--brand-on-primary);
    color: var(--brand-primary);
    font-size: 0.625rem;
    font-weight: 700;
}

.ia-bp-nav {
    padding: 0.5rem;
    border-right: 1px solid var(--bp-border);
    background: var(--bp-surface);
}

.ia-bp-nav-header {
    padding: 0.625rem 0.5rem 0.25rem;
    color: var(--bp-muted);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ia-bp-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.ia-bp-nav-active {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-weight: 500;
}

.ia-bp-main {
    min-width: 0;
    padding: 0.875rem;
}

.ia-bp-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ia-bp-page-title {
    color: var(--bp-strong);
    font-size: 0.9375rem;
    font-weight: 700;
}

.ia-bp-crumb {
    color: var(--bp-muted);
    font-size: 0.6875rem;
}

.ia-bp-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.375rem;
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    font-weight: 500;
    white-space: nowrap;
}

.ia-bp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ia-bp-card {
    border: 1px solid var(--bp-border);
    border-radius: 0.375rem;
    background: var(--bp-surface);
    overflow: hidden;
}

.ia-bp-stat {
    padding: 0.5rem 0.625rem;
}

.ia-bp-stat-label {
    color: var(--bp-muted);
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ia-bp-stat-value {
    color: var(--bp-strong);
    font-size: 1rem;
    font-weight: 700;
}

.ia-bp-card-head {
    display: flex;
    align-items: center;
    padding: 0.4375rem 0.625rem;
    border-bottom: 1px solid var(--bp-border);
    background: var(--bp-head);
    color: var(--bp-strong);
    font-weight: 600;
}

.ia-bp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    white-space: nowrap;
}

.ia-bp-row + .ia-bp-row {
    border-top: 1px solid var(--bp-border);
}

.ia-bp-muted {
    color: var(--bp-muted);
}

.ia-bp-accent,
.ia-bp-link {
    color: var(--brand-accent);
}

.ia-bp-link {
    font-weight: 500;
}

.ia-bp-badge {
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
    background: var(--brand-accent);
    color: var(--brand-on-accent);
    font-size: 0.625rem;
    font-weight: 600;
}

.ia-bp-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    color: var(--bp-muted);
    font-size: 0.875rem;
}

/* On a phone the bar wraps; a divider would then stand alone, so it goes. */
@media (max-width: 767.98px) {
    .ia-profile:has(.ia-profile-divider) {
        flex-wrap: wrap;
    }

    .ia-profile-divider {
        display: none;
    }
}

/* The small mark beside a name in a list (a tenant's logo or initials). */
.ia-avatar-sm {
    flex: none;
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

/* A logo in the avatar's place: whole (contained, not cropped), on the background it was made
   for, white or, for a dark mode logo, dark, whatever the console's theme. */
img.ia-avatar.ia-avatar-logo {
    flex: none;
    padding: 2px;
    border: 1px solid var(--ia-border);
    background: #ffffff;
    object-fit: contain;
}

img.ia-avatar.ia-avatar-logo-dark {
    border-color: #34343c;
    background: #17171b;
}

/* A pair drawn for both themes (a tenant's light and dark logos): the theme shows one. */
.ia-theme-dark-only,
[data-bs-theme="dark"] .ia-theme-light-only {
    display: none;
}

[data-bs-theme="dark"] .ia-theme-dark-only {
    display: inline-flex;
}

/* A photo fills the square however it was shaped. */
img.ia-avatar {
    object-fit: cover;
}

/* The profile picture as a button: hovering (or tabbing to it) lays a pencil over it, and a
   click opens the upload-and-crop modal. */
.ia-avatar-edit {
    position: relative;
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    border-radius: var(--ia-radius);
    overflow: hidden;
    cursor: pointer;
}

.ia-avatar-edit-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.55);
    color: #fff;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ia-avatar-edit:hover .ia-avatar-edit-overlay,
.ia-avatar-edit:focus-visible .ia-avatar-edit-overlay {
    opacity: 1;
}

/* The upload-and-crop modal (Views/Shared/_ImageCropModal.cshtml). The choose area is a
   dashed box that is also the drop target; the stage holds the picture being cropped. */
.ia-crop-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--ia-muted);
    border-radius: var(--ia-radius);
    text-align: center;
    cursor: pointer;
}

.ia-crop-drop > .bi {
    font-size: 2rem;
    color: var(--ia-muted);
}

.ia-crop-drop:hover,
.ia-crop-drop.is-dragover {
    border-color: var(--ia-dark);
    background: var(--ia-bg);
}

.ia-crop-stage {
    height: min(60vh, 26rem);
    background: var(--ia-bg);
    border-radius: var(--ia-radius);
    overflow: hidden;
}

.ia-crop-stage img {
    display: block;
    max-width: 100%;
}

/* A label / value list in a narrow container: label muted on the left, value on the right. */
.ia-facts {
    display: grid;
    grid-template-columns: minmax(6rem, auto) 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.ia-facts dt {
    color: var(--ia-muted);
    font-weight: 400;
}

.ia-facts dd {
    margin: 0;
    text-align: right;
}

/* Tabs in a card's header, in the console's colours rather than Bootstrap's blue. The header
   is tighter above the tabs than a titled header, and not bold: the active tab carries that. */
.ia-tabs-header {
    --bs-card-cap-padding-y: 0.75rem;
    font-weight: 400;
}

.ia-tabs-header .nav-link {
    color: var(--ia-text);
}

.ia-tabs-header .nav-link.active {
    color: var(--ia-dark);
    font-weight: 500;
}

/* A choice as a bordered box: the radio, a title, and a muted line under it
   (Views/Shared/_ActiveChoice.cshtml). The chosen box takes the structural colour. */
.ia-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    height: 100%;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-surface);
    cursor: pointer;
}

.ia-choice .form-check-input {
    flex: none;
    margin: 0.2rem 0 0;
}

.ia-choice:hover {
    border-color: var(--ia-muted);
}

.ia-choice:has(.form-check-input:checked) {
    border-color: var(--ia-dark);
    box-shadow: inset 0 0 0 1px var(--ia-dark);
}

.ia-choice:has(.form-check-input:disabled) {
    cursor: default;
    opacity: 0.7;
}

.ia-choice-title {
    display: block;
    color: var(--ia-dark);
    font-weight: 500;
}

.ia-choice-text {
    display: block;
    color: var(--ia-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* The line under the Active / Inactive choice: from one edge of the card to the other, the
   card's own padding taken back on both sides. */
.ia-choice-divider {
    margin: var(--ia-card-pad, 1.25rem) calc(-1 * var(--ia-card-pad, 0px));
    border: 0;
    border-top: 1px solid var(--ia-border);
    opacity: 1;
}

/* The same box for checkboxes, which share every rule above. The small one is for a grid of
   short choices with a title only (a holiday's currencies). */
.ia-choice-sm {
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.ia-choice-sm .form-check-input {
    margin-top: 0;
}

/* Country flags (Views/Shared/_CountryFlag.cshtml). 4:3, with a hairline so white flags
   still have an edge on a white row. */
.ia-flag {
    display: inline-block;
    flex: none;
    width: 2rem;
    height: 1.5rem;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
    box-shadow: 0 0 0 1px var(--ia-hairline);
}

/* A table column holding only the flag, which fills the cell inside a 5px border on every
   side. The row's height is set by the other cells, so the flag is laid over the cell rather
   than sized itself, and keeps the same 5px above and below whatever height the row takes.
   The width makes the inner area 4:3 of the usual row (about 45px tall inside), so the flag
   is barely cropped. */
.table > thead > tr > th.ia-flag-cell,
.table > tbody > tr > td.ia-flag-cell {
    position: relative;
    width: 4.375rem;
    min-width: 4.375rem;
    padding: 5px;
}

.ia-flag-cell .ia-flag {
    position: absolute;
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 2px;
    box-shadow: 0 0 0 1px var(--ia-hairline);
}

.ia-flag-none {
    background: var(--ia-bg);
}

.alert {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    font-size: 0.9375rem;
}

.alert-success { background: #e8f5ee; border-color: #cbe8d9; color: #1f7a4d; }
.alert-danger  { background: #fdeaea; border-color: #f5cfcf; color: var(--ia-red-text); }

[data-bs-theme="dark"] .alert-success { background: rgba(46, 160, 103, 0.14); border-color: rgba(46, 160, 103, 0.35); color: #7fdcae; }
[data-bs-theme="dark"] .alert-danger  { background: rgba(255, 90, 90, 0.12); border-color: rgba(255, 90, 90, 0.32); }

/* ---------------------------------------------------------- auth pages */

.ia-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--ia-bg);
}

.ia-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-lg);
    padding: 2rem;
}

.ia-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ia-dark);
    letter-spacing: -0.02em;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .ia-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .ia-sidebar.show {
        transform: translateX(0);
        box-shadow: var(--ia-shadow-lg);
    }

    .ia-content {
        margin-left: 0;
    }

    .ia-page {
        padding: 1rem;
    }
}

/* ------------------------------------------------------------------ form builder
   A template's form builder (Views/EntityManagement/Shared/Builder.cshtml, js/form-builder.js),
   laid out as the monorepo's: one card with the title and Preview / JSON / Save form across the
   top; the form on the left (hint, hidden fields, a dashed canvas of field previews) and the
   components on the right. */

/* Kept beside a long page (the preview's rule log). */
.ia-fb-sticky {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - var(--ia-topbar-height) - 2rem);
    overflow-y: auto;
}

.ia-fb {
    overflow: visible;
}

.ia-fb-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-fb-muted {
    color: var(--ia-muted);
}

.ia-fb-body {
    display: flex;
    align-items: flex-start;
}

.ia-fb-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 1.25rem 1.25rem;
}

.ia-fb-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--ia-muted);
    font-size: 0.8125rem;
}

/* The hidden fields: the SYSTEM-* ones every form has, and hidden inputs, as a list above the canvas. */
.ia-fb-hidden {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-card-head-bg);
}

.ia-fb-hidden-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-text);
    font-size: 0.8125rem;
    font-weight: 500;
}

.ia-fb-hidden-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.ia-fb-hidden-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    background: var(--ia-surface);
    font-size: 0.8125rem;
}

.ia-fb-hidden-item:hover {
    border-color: var(--ia-muted);
}

.ia-fb-hidden-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ia-fb-hidden-actions,
.ia-fb-actions {
    display: flex;
    gap: 0.25rem;
}

.ia-fb-hidden-actions .btn,
.ia-fb-actions .btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1.4;
}

.ia-fb-has-rules {
    border-color: var(--ia-dark);
    color: var(--ia-dark);
    font-weight: 600;
}

/* The canvas: a dashed drop zone holding the fields on a 12-column grid. */
.ia-fb-canvas {
    min-height: 18rem;
    padding: 0.875rem;
    border: 2px dashed var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-surface);
}

/* A field: its label, a disabled preview of its input, its description, and its width. Hovering
   shows its buttons; the grip on the left says it can be dragged. */
.ia-fb-field {
    position: relative;
    height: 100%;
    padding: 0.625rem 0.75rem 1.375rem 1.75rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    background: var(--ia-surface);
    cursor: grab;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ia-fb-field:hover,
.ia-fb-field:focus-visible {
    border-color: var(--ia-dark);
    box-shadow: 0 2px 8px var(--ia-focus-ring-soft);
    outline: 0;
}

.ia-fb-field.ia-fb-selected {
    border-color: var(--ia-dark);
}

.ia-fb-field.ia-fb-dragging {
    opacity: 0.45;
}

.ia-fb-field.ia-fb-drop-before,
.ia-fb-drop-end.ia-fb-drop-before {
    box-shadow: -3px 0 0 var(--ia-red);
}

.ia-fb-handle {
    position: absolute;
    top: 50%;
    left: 0.375rem;
    transform: translateY(-50%);
    color: var(--ia-muted);
    font-size: 0.875rem;
}

.ia-fb-actions {
    position: absolute;
    top: 0.3125rem;
    right: 0.3125rem;
    display: none;
    padding: 0.125rem;
    border-radius: 0.3rem;
    background: var(--ia-surface);
    box-shadow: var(--ia-shadow);
    z-index: 2;
}

.ia-fb-field:hover .ia-fb-actions,
.ia-fb-field:focus-within .ia-fb-actions {
    display: flex;
}

.ia-fb-field-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.375rem;
    color: var(--ia-dark);
    font-size: 0.8125rem;
    font-weight: 500;
}

.ia-fb-field-label.ia-fb-muted {
    color: var(--ia-muted);
    font-weight: 400;
}

.ia-fb-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
    background: var(--ia-bg);
    color: var(--ia-muted);
    font-size: 0.6875rem;
    font-weight: 500;
}

.ia-fb-pill-onboarding {
    background: #e8f5ee;
    color: #1f7a4d;
}

.ia-fb-pill-unique {
    background: #fdf3e0;
    color: #7a5601;
}

[data-bs-theme="dark"] .ia-fb-pill-onboarding { background: rgba(46, 160, 103, 0.18); color: #74d6a4; }
[data-bs-theme="dark"] .ia-fb-pill-unique { background: rgba(245, 180, 40, 0.16); color: #f0c46a; }

.ia-fb-preview {
    font-size: 0.8125rem;
}

.ia-fb-preview .form-control:disabled,
.ia-fb-preview .form-select:disabled {
    background-color: var(--ia-bg);
    pointer-events: none;
}

.ia-fb-heading-text {
    color: var(--ia-dark);
    font-size: 0.9375rem;
    font-weight: 700;
}

.ia-fb-divider-line {
    margin: 0.25rem 0 0;
    opacity: 0.4;
}

.ia-fb-signature {
    padding: 0.5rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-muted);
    text-align: center;
}

.ia-fb-description {
    max-width: calc(100% - 3rem);
    margin-top: 0.25rem;
    overflow: hidden;
    color: var(--ia-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ia-fb-badges {
    position: absolute;
    right: 0.5rem;
    bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ia-fb-size,
.ia-fb-rule-count {
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.1875rem;
    background: var(--ia-bg);
    color: var(--ia-muted);
    font-size: 0.65rem;
}

.ia-fb-rule-count {
    color: var(--ia-dark);
    font-weight: 600;
}

.ia-fb-empty,
.ia-fb-drop-end {
    padding: 0.625rem;
    border: 1px dashed var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.ia-fb-empty {
    padding: 4rem 1rem;
    border: 0;
}

.ia-fb-empty i {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
}

/* The components: the field catalogue in collapsible groups, one per row, left of the form and kept in view. */
.ia-fb-components {
    position: sticky;
    top: 1rem;
    flex: none;
    display: flex;
    flex-direction: column;
    width: 17.5rem;
    max-height: calc(100dvh - var(--ia-topbar-height) - 2rem);
    border-right: 1px solid var(--ia-border);
    align-self: flex-start;
}

.ia-fb-components-title {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-dark);
    font-weight: 600;
}

.ia-fb-components-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-fb-components-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.5rem;
}

.ia-fb-group + .ia-fb-group {
    margin-top: 0.5rem;
}

.ia-fb-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4375rem 0.75rem;
    border: 0;
    border-radius: 0.3rem;
    background: var(--ia-card-head-bg);
    color: var(--ia-dark);
    font-size: 0.8125rem;
    font-weight: 500;
}

.ia-fb-group-header:hover {
    background: var(--ia-hairline);
}

.ia-fb-group-header i {
    transition: transform 0.15s ease;
}

.ia-fb-group.ia-fb-collapsed .ia-fb-group-header i {
    transform: rotate(-90deg);
}

.ia-fb-group.ia-fb-collapsed .ia-fb-group-items {
    display: none;
}

.ia-fb-group-items {
    padding: 0.25rem 0;
}

.ia-fb-component {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.4375rem 0.75rem;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    color: var(--ia-text);
    font-size: 0.8125rem;
    text-align: left;
    cursor: grab;
}

.ia-fb-component i {
    width: 1.125rem;
    color: var(--ia-muted);
    text-align: center;
}

.ia-fb-component:hover,
.ia-fb-component:focus-visible {
    background: var(--ia-bg);
    color: var(--ia-dark);
    outline: 0;
}

.ia-fb-component[hidden] {
    display: none;
}

/* The settings modal's sections. */
.ia-fb-config-section + .ia-fb-config-section {
    margin-top: 1.5rem;
}

.ia-fb-config-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-dark);
    font-weight: 600;
}

.ia-fb-nested {
    margin-left: 0.25rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--ia-border);
}

.ia-fb-json {
    max-height: 70vh;
    margin: 0;
    padding: 1rem 1.25rem;
    overflow: auto;
    background: var(--ia-bg);
    color: var(--ia-text);
    font-size: 0.75rem;
}

/* The rules modal: the field's rules on the left, the chosen one's tabs on the right. */
.ia-rule-panes {
    display: flex;
    min-height: 26rem;
}

.ia-rule-list-pane {
    flex: none;
    width: 17rem;
    min-width: 0;
    overflow: hidden;
    padding: 1rem;
    border-right: 1px solid var(--ia-border);
    background: var(--ia-card-head-bg);
}

.ia-rule-editor-pane {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 1.25rem;
}

.ia-rule-card {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    background: var(--ia-surface);
    color: var(--ia-text);
    text-align: left;
}

.ia-rule-card:hover {
    border-color: var(--ia-muted);
}

.ia-rule-card.active {
    border-color: var(--ia-dark);
    box-shadow: 0 0 0 0.15rem var(--ia-focus-ring-soft);
}

/* The rule's tabs in the console's colours, not Bootstrap's blue. */
.ia-rule-editor-pane .nav-tabs .nav-link {
    color: var(--ia-text);
}

.ia-rule-editor-pane .nav-tabs .nav-link:hover {
    color: var(--ia-dark);
}

.ia-rule-editor-pane .nav-tabs .nav-link.active {
    color: var(--ia-dark);
    font-weight: 500;
}

.ia-rule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    height: 100%;
    min-height: 20rem;
    color: var(--ia-muted);
    text-align: center;
}

.ia-rule-empty i {
    font-size: 1.75rem;
}

.ia-rule-leaf {
    padding: 0.5rem 0.625rem 0.625rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    background: var(--ia-card-head-bg);
}

.ia-rule-join {
    width: 5rem;
    margin: 0.375rem 0 0.375rem 1rem;
}

@media (max-width: 991.98px) {
    .ia-fb-body,
    .ia-rule-panes {
        flex-direction: column;
    }

    .ia-fb-components,
    .ia-rule-list-pane {
        position: static;
        width: 100%;
        max-height: none;
        border-left: 0;
        border-right: 0;
        border-bottom: 1px solid var(--ia-border);
    }
}

/* A template's form preview (Views/EntityManagement/Shared/Preview.cshtml, js/form-preview.js). The
   frame takes its own light or dark theme (data-bs-theme), whatever the console's. */
/* Dark inside a light page: the tokens defined from others on :root (--ia-dark) and the text
   colour arrive here already worked out in light, so they are set again from the dark tokens. */
.ia-pv-frame[data-bs-theme="dark"] {
    --ia-dark: var(--ia-charcoal);
    padding: 1rem;
    border-radius: var(--ia-radius);
    background: var(--ia-bg);
    color: var(--ia-text);
}

.ia-pv-heading {
    margin: 0.5rem 0 0;
    color: var(--ia-dark);
    font-weight: 700;
}

.ia-pv-signature {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 6rem;
    border: 1px dashed var(--ia-border);
    border-radius: var(--ia-radius);
    color: var(--ia-muted);
}

.ia-pv-log-line {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--ia-border);
}

/* Date pickers (js/date-pickers.js, flatpickr as the monorepo uses it): the calendar in the
   console's colours, light and dark alike through the tokens. The box shown in place of a date
   input wears the input's own classes, with a calendar mark at its end. */
.ia-date-input {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a7a4b1'%3e%3cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.875rem;
}

.ia-date-input.form-control-sm {
    padding-right: 2rem;
    background-position: right 0.625rem center;
    background-size: 0.75rem;
}

.ia-date-input[readonly]:not(:disabled) {
    background-color: var(--ia-surface);
}

/* In an input group the original input (now hidden) stays first: the shown box is the group's
   start as far as the eye goes, so it keeps the rounded start Bootstrap gives a first child. */
.input-group > input[type="hidden"]:first-child + .ia-date-input {
    margin-left: 0;
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
}

.input-group-sm > input[type="hidden"]:first-child + .ia-date-input {
    border-top-left-radius: var(--bs-border-radius-sm);
    border-bottom-left-radius: var(--bs-border-radius-sm);
}

/* Inside a modal the calendar sits by its input (static), in a wrapper as wide as the input was. */
.flatpickr-wrapper {
    display: block;
    width: 100%;
}

.flatpickr-calendar {
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-lg);
    color: var(--ia-text);
    font-family: inherit;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowBottom::before {
    border-bottom-color: var(--ia-border);
    border-top-color: var(--ia-border);
}

.flatpickr-calendar.arrowTop::after {
    border-bottom-color: var(--ia-surface);
}

.flatpickr-calendar.arrowBottom::after {
    border-top-color: var(--ia-surface);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--ia-charcoal);
    fill: var(--ia-charcoal);
    font-weight: 600;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--ia-surface);
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month .numInputWrapper:hover {
    background: var(--ia-bg);
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--ia-text);
    fill: var(--ia-text);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--ia-red);
}

span.flatpickr-weekday {
    color: var(--ia-muted);
    font-weight: 600;
}

.flatpickr-day {
    color: var(--ia-text);
    border-radius: 0.375rem;
}

.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: var(--ia-bg);
    border-color: var(--ia-bg);
    color: var(--ia-charcoal);
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--ia-muted);
    opacity: 0.55;
}

.flatpickr-day.today,
span.flatpickr-day.today:not(.selected) {
    border-color: var(--ia-red);
    color: var(--ia-charcoal);
    background: transparent;
}

.flatpickr-day.today:hover,
span.flatpickr-day.today:not(.selected):hover {
    background: var(--ia-red);
    border-color: var(--ia-red);
    color: #fff;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.selected.nextMonthDay {
    background: var(--ia-action);
    border-color: var(--ia-action);
    color: var(--ia-on-dark);
    opacity: 1;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange {
    background: var(--ia-bg);
    border-color: var(--ia-bg);
    box-shadow: -5px 0 0 var(--ia-bg), 5px 0 0 var(--ia-bg);
    color: var(--ia-charcoal);
}

.flatpickr-calendar.hasTime .flatpickr-time {
    border-top: 1px solid var(--ia-border);
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--ia-charcoal);
}

.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
    background: var(--ia-bg);
}

.numInputWrapper span.arrowUp::after {
    border-bottom-color: var(--ia-text);
}

.numInputWrapper span.arrowDown::after {
    border-top-color: var(--ia-text);
}

/* A tenant's legal documents (Views/Tenants/Legal*.cshtml). */
.ia-legal-kinds {
    width: 22rem;
}

.ia-legal-kinds .dropdown-item {
    display: flex;
    align-items: flex-start;
    white-space: normal;
}

.ia-legal-versions .list-group-item.active {
    background: var(--ia-bg);
    border-color: var(--ia-border);
    color: var(--ia-charcoal);
    box-shadow: inset 3px 0 0 var(--ia-red);
}

/* A tenant's Modules tab (Views/Tenants/Modules/Index.cshtml): the list of its modules, the one shown beside it
   marked as a legal document's current version is. */
.ia-module-list .list-group-item.active {
    background: var(--ia-bg);
    border-color: var(--ia-border);
    color: var(--ia-charcoal);
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--ia-red);
}

.ia-legal-version-meta {
    color: var(--ia-muted);
}

.ia-legal-tabs {
    border-bottom: 0;
}

.ia-legal-pane {
    border: 1px solid var(--ia-border);
    border-radius: 0 var(--ia-radius) var(--ia-radius) var(--ia-radius);
}

.ia-legal-editor {
    border: 0;
    border-radius: 0 var(--ia-radius) var(--ia-radius) var(--ia-radius);
    min-height: 28rem;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

.ia-legal-preview {
    min-height: 28rem;
    padding: 1rem 1.25rem;
}

.ia-legal-view-pills .nav-link {
    padding: 0.2rem 0.75rem;
    font-size: 0.8125rem;
}

.ia-legal-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.5rem;
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ia-border);
    background: var(--ia-head-bg);
}

.ia-legal-facts dt {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ia-muted);
}

.ia-legal-facts dd {
    margin: 0;
}

.ia-legal-facts-wide {
    grid-column: 1 / -1;
}

.ia-legal-hash {
    word-break: break-all;
    font-size: 0.75rem;
}

.ia-legal-source {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.8125rem;
    color: var(--ia-text);
}

/* Rendered Markdown (Library.Content's MarkdownRenderer): a document as clients read it. */
.ia-markdown {
    color: var(--ia-text);
    line-height: 1.65;
    max-width: 52rem;
}

.ia-markdown h1, .ia-markdown h2, .ia-markdown h3, .ia-markdown h4 {
    color: var(--ia-charcoal);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.ia-markdown h1 { font-size: 1.5rem; margin-top: 0; }
.ia-markdown h2 { font-size: 1.2rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--ia-border); }
.ia-markdown h3 { font-size: 1.05rem; }
.ia-markdown h4 { font-size: 0.95rem; }

.ia-markdown p, .ia-markdown ul, .ia-markdown ol, .ia-markdown table, .ia-markdown blockquote {
    margin-bottom: 1rem;
}

.ia-markdown a {
    color: var(--ia-red-text);
}

.ia-markdown blockquote {
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--ia-border);
    color: var(--ia-muted);
}

.ia-markdown table {
    width: 100%;
    border-collapse: collapse;
}

.ia-markdown th, .ia-markdown td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--ia-border);
}

.ia-markdown th {
    background: var(--ia-head-bg);
    color: var(--ia-charcoal);
}

.ia-markdown code {
    color: var(--ia-charcoal);
}

.ia-markdown hr {
    border-color: var(--ia-border);
    opacity: 1;
}

/* The profile bar's Endpoints box (Views/Tenants/_TenantProfile.cshtml): a box like Environment's
   that is also a button to the Endpoints page, ringed while that page is open. */
.ia-profile-env-link {
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease-in-out, filter 0.15s ease-in-out;
}

.ia-profile-env-link:hover,
.ia-profile-env-link:focus-visible {
    color: inherit;
    filter: brightness(0.96);
    box-shadow: 0 0 0 1px var(--ia-border);
}

.ia-profile-env-current {
    box-shadow: 0 0 0 2px var(--ia-dark);
}

.ia-profile-env-current:hover {
    box-shadow: 0 0 0 2px var(--ia-dark);
}

.ia-profile-env .ia-profile-env-go {
    font-size: 0.875rem;
    opacity: 0.6;
}

/* A tenant's endpoints (Views/Tenants/Endpoints.cshtml). */
.ia-endpoint-host {
    min-width: 0;
    word-break: break-all;
}

.ia-endpoint-off .ia-endpoint-host > span,
.ia-endpoint-off .ia-endpoint-host > a {
    color: var(--ia-muted);
    text-decoration: line-through;
}

.ia-endpoint-dns > summary {
    cursor: pointer;
    color: var(--ia-text);
}

.ia-endpoint-dns code {
    word-break: break-all;
}

/* Where applying an endpoint stands (Views/Tenants/Endpoints.cshtml): its steps in a row, done
   ticked, the current one half filled (red when it failed), the rest open. */
.ia-endpoint-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--ia-muted);
}

.ia-endpoint-steps li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ia-endpoint-steps li.is-done {
    color: var(--ia-text);
}

.ia-endpoint-steps li.is-done > i {
    color: #1f9d55;
}

.ia-endpoint-steps li.is-current {
    color: var(--ia-charcoal);
    font-weight: 600;
}

.ia-endpoint-steps li.is-failed {
    color: var(--ia-red-text);
    font-weight: 600;
}

/* A value not known yet: the Key Vault key it comes from, or when it will be known. */
.ia-endpoint-placeholder {
    font-family: var(--bs-font-monospace);
    font-size: 0.8em;
    color: var(--ia-muted);
    font-style: italic;
}

.ia-copy {
    color: var(--ia-muted);
    line-height: 1;
}

.ia-copy:hover {
    color: var(--ia-charcoal);
}

/* A sandbox tenant (TenantEnvironments.Sandbox): its profile bar and its row in the tenant list
   striped like the top bar's environment tape (--ia-sandbox-stripes), with no fade. The row's
   stripes are drawn once across the whole row: its cells are made see-through, Bootstrap's own
   cell background and hover shade with them. */
.card.ia-sandbox-stripes {
    background-image: var(--ia-sandbox-stripes);
}

.table > tbody > tr.ia-sandbox-row {
    background-image: var(--ia-sandbox-stripes);
}

.table > tbody > tr.ia-sandbox-row > * {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    background-color: transparent;
    box-shadow: none;
}

/* A badge that is the point of its cell (a tenant's environment in the tenant list): larger than
   the small badges that annotate. */
.badge.ia-badge-lg {
    padding: 0.45em 0.8em;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

/* The tenant profile checker (Views/Tenants/Detail.cshtml): three sections side by side, each a
   link to where it is fixed over its items, marked in place, not quite, missing or not needed. */
.ia-profile-check-section + .ia-profile-check-section {
    border-left: 1px solid var(--ia-border);
}

@media (max-width: 767.98px) {
    .ia-profile-check-section + .ia-profile-check-section {
        border-left: 0;
        border-top: 1px solid var(--ia-border);
    }
}

.ia-profile-check-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-charcoal);
    font-weight: 600;
    text-decoration: none;
}

.ia-profile-check-title:hover {
    background: var(--ia-bg);
    color: var(--ia-charcoal);
}

.ia-profile-check-items {
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
}

.ia-profile-check-items li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.4rem 1.25rem;
    font-size: 0.875rem;
}

.ia-profile-check-items li > i {
    margin-top: 0.125rem;
}

.ia-profile-check-items .is-ok > i { color: #1f9d55; }
.ia-profile-check-items .is-warning > i { color: #d4a000; }
.ia-profile-check-items .is-missing > i { color: var(--ia-red-text); }
.ia-profile-check-items .is-optional > i { color: var(--ia-muted); }
.ia-profile-check-items .is-optional { color: var(--ia-muted); }

/* Scrollbars, everywhere (the page, the sidebar, tables, modals, the form builder): 6px, rounded,
   no arrow buttons, and out of sight until wanted. A scrolling area's thumb shows while the pointer
   is over it (the page under the top bar, the menu under the logo, a modal, a table), and while it
   scrolls (site.js marks it .ia-scrolling for a moment).

   Chromium and Safari: ::-webkit-scrollbar, which Chromium drops entirely once scrollbar-width or
   scrollbar-color is set, so those two are given to Firefox alone (thin there has no buttons,
   and hides as the system says). */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 6px;
}

body *:hover::-webkit-scrollbar-thumb,
.ia-scrolling::-webkit-scrollbar-thumb {
    background: var(--ia-scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
    background: var(--ia-scrollbar-thumb-hover) !important;
}

/* Room for the scrollbar is kept in the menu and the page whether or not there is anything to
   scroll, so nothing moves when a scrollbar comes or goes (a menu group opened, a page grown past
   the screen): the thumb only fades in and out. */
.ia-sidebar-scroll,
.ia-page {
    scrollbar-gutter: stable;
}

@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--ia-scrollbar-thumb) transparent;
    }
}

/* ---------------------------------------------------------- support tickets

   The list (Views/SupportTickets/Index, _TicketTable), a ticket's page (Detail: the timeline, the
   composer, the properties card) and the Markdown box with Write / Preview (support-tickets.js). */

/* A count inside a view pill (Open 12): quiet, and readable on the active pill too. */
.ia-pill-count {
    display: inline-block;
    min-width: 1.5rem;
    margin-left: 0.25rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--ia-hairline);
    font-size: 0.75rem;
    line-height: 1.25rem;
    text-align: center;
}

.ia-page-pills .nav-link.active .ia-pill-count {
    background: color-mix(in srgb, var(--ia-on-dark) 22%, transparent);
}

.ia-ticket-ref {
    flex: none;
    font-family: var(--bs-font-monospace);
    font-size: 0.8125rem;
    color: var(--ia-muted);
    text-decoration: none;
}

.ia-ticket-ref:hover {
    color: var(--ia-charcoal);
}

.ia-ticket-subject {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The timeline: messages as cards hung off a thin line, each with its author's initials; changes
   as quiet lines between them. */
.ia-timeline {
    position: relative;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.ia-timeline::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 1.0625rem;
    width: 2px;
    background: var(--ia-timeline-line);
}

.ia-tl-message {
    position: relative;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ia-tl-avatar {
    position: relative;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
    box-shadow: 0 0 0 3px var(--ia-bg);
}

.ia-tl-requester .ia-tl-avatar {
    background: var(--ia-requester);
    color: var(--ia-on-dark);
}

.ia-tl-card {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.ia-tl-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-charcoal);
}

.ia-tl-body {
    padding: 0.875rem 1rem;
    max-width: none;
    overflow-wrap: anywhere;
}

.ia-tl-body > :last-child {
    margin-bottom: 0;
}

.ia-tl-note .ia-tl-card {
    background: var(--ia-note-bg);
    border-color: var(--ia-note-border);
}

.ia-tl-note .ia-tl-card-head {
    border-bottom-color: var(--ia-note-border);
}

.ia-tl-requester .ia-tl-card {
    border-left: 3px solid var(--ia-requester);
}

.ia-tl-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 0.875rem;
}

.ia-tl-picture {
    display: block;
    flex: 0 0 100%;
}

.ia-tl-picture img {
    max-width: min(100%, 22rem);
    max-height: 14rem;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    object-fit: contain;
    background: var(--ia-surface);
}

.ia-tl-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 14rem;
    max-width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-surface);
    color: var(--ia-text);
    font-size: 0.8125rem;
    text-decoration: none;
}

.ia-tl-file:hover {
    border-color: var(--ia-muted);
    color: var(--ia-charcoal);
}

.ia-tl-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ia-tl-event {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.375rem;
    margin: 0 0 1rem;
    padding-left: 3rem;
    font-size: 0.8125rem;
    color: var(--ia-text);
}

.ia-tl-event > .bi {
    position: absolute;
    left: 0.5625rem;
    top: 0;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: var(--ia-bg);
    color: var(--ia-muted);
    font-size: 0.8125rem;
    line-height: 1.125rem;
    text-align: center;
}

.ia-tl-event strong {
    color: var(--ia-charcoal);
    font-weight: 500;
}

/* The composer: what to add as a segmented choice in its header; shaded as a note while it is one. */
.ia-composer-head {
    padding: 0.5rem 0.75rem;
}

.ia-composer-kinds {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ia-composer-kind {
    border: 1px solid transparent;
    color: var(--ia-text);
}

.ia-composer-kind:hover {
    background: var(--ia-hairline);
    color: var(--ia-charcoal);
}

.btn-check:checked + .ia-composer-kind {
    background: var(--ia-dark);
    border-color: var(--ia-dark);
    color: var(--ia-on-dark);
}

.ia-composer.ia-composer-note {
    background: var(--ia-note-bg);
    border-color: var(--ia-note-border);
}

.ia-composer.ia-composer-requester {
    border-left: 3px solid var(--ia-requester);
}

.ia-composer-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ia-ticket-file-list {
    margin: 0.375rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--ia-text);
}

.ia-ticket-file-list:empty {
    display: none;
}

/* The Markdown box: Write / Preview tabs over the text, one bordered box. */
.ia-md-editor {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-surface);
}

.ia-md-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--ia-border);
    background: var(--ia-card-head-bg);
    border-radius: var(--ia-radius) var(--ia-radius) 0 0;
}

.ia-md-tab {
    padding: 0.25rem 0.625rem;
    border: 0;
    border-radius: calc(var(--ia-radius) - 0.125rem);
    background: transparent;
    color: var(--ia-text);
    font-size: 0.8125rem;
}

.ia-md-tab:hover {
    background: var(--ia-hairline);
}

.ia-md-tab.active {
    background: var(--ia-surface);
    color: var(--ia-charcoal);
    box-shadow: var(--ia-shadow);
    font-weight: 500;
}

.ia-md-source {
    border: 0;
    border-radius: 0 0 var(--ia-radius) var(--ia-radius);
    min-height: 8rem;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

.ia-md-source:focus {
    box-shadow: none;
}

.ia-md-editor:focus-within {
    border-color: var(--ia-muted);
    box-shadow: 0 0 0 0.2rem var(--ia-focus-ring-soft);
}

.ia-md-preview {
    min-height: 8rem;
    padding: 0.75rem 1rem;
    max-width: none;
}

/* The properties card: the four that change on their own (a label over a small select), then
   the rest as a list. Kept in view while the timeline scrolls. */
.ia-ticket-props {
    position: sticky;
    top: 1rem;
}

.ia-prop + .ia-prop {
    margin-top: 0.75rem;
}

.ia-prop-label,
.ia-prop-list dt {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ia-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ia-prop-list {
    margin: 0;
}

.ia-prop-list dd {
    margin: 0 0 0.875rem;
    color: var(--ia-charcoal);
    overflow-wrap: anywhere;
}

.ia-prop-list dd:last-child {
    margin-bottom: 0;
}

/* The support settings page's "how it is set up" list. */
.ia-settings-list dt {
    color: var(--ia-charcoal);
    font-weight: 500;
}

.ia-settings-list dd {
    margin: 0.25rem 0 1rem;
}

.ia-settings-list dd:last-child {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .ia-ticket-props {
        position: static;
    }
}

/* A provider's setting value (an address, a sender, a URL): long and unbroken, so it wraps anywhere. */
.ia-setting-value {
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------- dashboard

   Views/Dashboard: the greeting, the attention list, the figures with sparklines, the column charts
   (SVG drawn on the server, _ColumnChart, with dashboard.js's tooltip), your tickets, platform health
   and the activity feeds. */

.ia-greeting {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}

.ia-greeting-hello {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--ia-charcoal);
}

/* An icon in a soft disc, before a figure's label. */
.ia-stat-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--ia-hairline);
    color: var(--ia-charcoal);
    font-size: 1rem;
}

.ia-kpi-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ia-charcoal);
}

.ia-kpi:hover {
    border-color: var(--ia-muted);
}

.ia-sparkline {
    flex: 0 1 7.5rem;
    min-width: 3rem;
    width: 7.5rem;
    height: 2rem;
    overflow: visible;
}

.ia-sparkline polyline {
    fill: none;
    stroke: var(--ia-sparkline);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.ia-sparkline circle {
    fill: var(--ia-sparkline-point);
    stroke: var(--ia-surface);
    stroke-width: 2;
}

/* Needs attention: one row per item, critical ones marked red, warnings gold; the action at the end. */
.ia-attention-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-attention-list li:last-child {
    border-bottom: 0;
}

.ia-attention-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.ia-attention-critical .ia-attention-icon {
    background: #fdeaea;
    color: var(--ia-red-text);
}

.ia-attention-warning .ia-attention-icon {
    background: #fdf3e0;
    color: #7a5601;
}

[data-bs-theme="dark"] .ia-attention-critical .ia-attention-icon {
    background: rgba(255, 90, 90, 0.16);
}

[data-bs-theme="dark"] .ia-attention-warning .ia-attention-icon {
    background: rgba(245, 180, 40, 0.16);
    color: #f0c46a;
}

.ia-attention-text {
    min-width: 0;
    color: var(--ia-charcoal);
}

/* Column charts. */
.ia-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.ia-chart-grid {
    stroke: var(--ia-border);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.ia-chart-baseline {
    stroke: var(--ia-muted);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.ia-chart-axis {
    fill: var(--ia-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.ia-chart-series-1 {
    fill: var(--ia-chart-series-1);
    background: var(--ia-chart-series-1);
}

.ia-chart-series-2 {
    fill: var(--ia-chart-series-2);
    background: var(--ia-chart-series-2);
}

.ia-chart-hit {
    fill: transparent;
}

.ia-chart-col {
    outline: none;
}

.ia-chart-col:hover .ia-chart-hit,
.ia-chart-col:focus-visible .ia-chart-hit {
    fill: var(--ia-hairline);
}

.ia-chart-col:focus-visible .ia-chart-hit {
    stroke: var(--ia-focus-ring);
    stroke-width: 2;
}

.ia-chart-legend {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ia-text);
}

.ia-chart-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.375rem;
    border-radius: 3px;
    vertical-align: -0.0625rem;
}

.ia-chart-table {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.ia-chart-table summary {
    color: var(--ia-muted);
    cursor: pointer;
}

.ia-chart-table table {
    margin-top: 0.5rem;
}

.ia-num {
    font-variant-numeric: tabular-nums;
}

.ia-chart-tip {
    position: fixed;
    z-index: 1080;
    min-width: 9rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    background: var(--ia-surface);
    box-shadow: var(--ia-shadow-lg);
    font-size: 0.8125rem;
    color: var(--ia-text);
    pointer-events: none;
}

.ia-chart-tip-title {
    margin-bottom: 0.25rem;
    color: var(--ia-muted);
}

.ia-chart-tip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ia-chart-tip-row strong {
    min-width: 1.5rem;
    color: var(--ia-charcoal);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ia-chart-tip-key {
    display: inline-block;
    width: 0.75rem;
    height: 2px;
    border-radius: 1px;
}

/* The tickets' state in one line over the flow chart. */
.ia-ticket-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    font-size: 0.875rem;
}

.ia-ticket-summary a {
    color: var(--ia-text);
    text-decoration: none;
}

.ia-ticket-summary a:hover {
    color: var(--ia-charcoal);
}

.ia-ticket-summary strong {
    color: var(--ia-charcoal);
    font-weight: 600;
}

/* Your tickets, recent activity and sign-ins: rows with a mark or initials. */
.ia-my-tickets li,
.ia-feed li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--ia-border);
}

.ia-my-tickets li:last-child,
.ia-feed li:last-child {
    border-bottom: 0;
}

.ia-my-ticket-body,
.ia-feed-body {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Platform health. */
.ia-health-label {
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ia-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ia-health-endpoints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.875rem;
}

.ia-health-endpoints strong {
    font-weight: 600;
}

.ia-health-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.ia-health-name {
    min-width: 0;
    color: var(--ia-charcoal);
}

/* ------------------------------------------------------------------ tenant entity model (versioned)
   The version bar over each page of a tenant's Entities tab; a draft's is marked with a gold edge so an
   editable version is never mistaken for the one in use. The draft's problems sit under it. */
.ia-version-bar {
    border-left: 3px solid var(--ia-border);
}

.ia-version-bar.ia-version-draft {
    border-left-color: #d9a21b;
}

[data-bs-theme="dark"] .ia-version-bar.ia-version-draft {
    border-left-color: #f0c46a;
}

.ia-entity-problems ul {
    padding: 0.75rem 1rem;
}

.ia-entity-problems li + li {
    margin-top: 0.375rem;
}

/* Many short checkboxes (system identifiers, compliance checks) in columns, scrolling past a few rows. */
.ia-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.125rem 1rem;
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
}

.ia-input-count {
    width: 5.5rem;
}

/* The form builder's containers on a tenant type's form: the type's own fields, then each tag's. */
.ia-fb-container-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--ia-bg);
}

.ia-fb-container-head.ia-fb-container-tag {
    border-left: 3px solid var(--ia-chart-series-1);
}

.ia-fb-container-head.ia-fb-container-orphan {
    border-left: 3px solid var(--ia-red-text);
}

.ia-compare-table td:first-child {
    min-width: 12rem;
}

/* A list of checkboxes in columns (a module form's entity types and tags, Views/Tenants/Modules). */
.ia-check-columns {
    columns: 2 12rem;
    column-gap: 1.5rem;
}

.ia-check-columns .form-check {
    break-inside: avoid;
}

/* ------------------------------------------------------------------ knowledgebase (Views/KnowledgeBase) */

.ia-kb-search-input {
    position: relative;
}

.ia-kb-search-input .bi {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    transform: translateY(-50%);
    color: var(--ia-muted);
    pointer-events: none;
}

.ia-kb-search-input .form-control {
    padding-left: 2.5rem;
}

.ia-kb-lead {
    font-size: 1.0625rem;
    color: var(--ia-charcoal);
}

/* The menu beside every page: sections fold, the current article is marked as a chosen list row is. It and the
   headings list stick 1rem below the top of .ia-page, which is what scrolls (under the top bar, not behind it). */
.ia-kb-nav {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - var(--ia-topbar-height) - 2rem);
    overflow-y: auto;
}

.ia-kb-nav a {
    display: block;
    padding: 0.3125rem 0.625rem 0.3125rem 2rem;
    border-radius: var(--ia-radius);
    color: var(--ia-text);
    text-decoration: none;
    font-size: 0.875rem;
}

.ia-kb-nav a:hover {
    background: var(--ia-hairline);
    color: var(--ia-dark);
}

.ia-kb-nav a.active {
    background: var(--ia-bg);
    color: var(--ia-charcoal);
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--ia-red);
}

.ia-kb-nav .ia-kb-nav-home {
    padding-left: 0.625rem;
    margin-bottom: 0.5rem;
}

.ia-kb-nav-group summary {
    padding: 0.375rem 0.625rem;
    border-radius: var(--ia-radius);
    color: var(--ia-charcoal);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.ia-kb-nav-group summary::-webkit-details-marker {
    display: none;
}

.ia-kb-nav-group summary:hover {
    background: var(--ia-hairline);
}

.ia-kb-nav-group > a:last-child {
    margin-bottom: 0.375rem;
}

/* A section's card on the landing page, roomier than a list card, and its articles as a grid with lines between
   the cells: a frame round the grid, and each cell's right and bottom edge, the outermost ones hidden under it. */
.ia-kb-section .card-body {
    padding: 1.5rem 1.5rem 1.75rem;
}

.ia-kb-grid {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    overflow: hidden;
}

.ia-kb-grid ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    margin: 0 -1px -1px 0;
    padding: 0;
    list-style: none;
}

.ia-kb-grid li {
    border-right: 1px solid var(--ia-border);
    border-bottom: 1px solid var(--ia-border);
}

.ia-kb-grid a {
    display: block;
    height: 100%;
    min-height: 5.5rem;
    padding: 0.875rem 1rem;
    color: var(--ia-text);
    text-decoration: none;
}

.ia-kb-grid a:hover {
    background: var(--ia-head-bg);
}

.ia-kb-grid a:hover .ia-kb-grid-title {
    color: var(--ia-red-text);
}

.ia-kb-grid-title {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--ia-charcoal);
    font-weight: 500;
    font-size: 0.9375rem;
}

.ia-kb-grid-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--ia-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

/* An article's text, from Markdown: headings, tables, code, alerts and screenshots in the console's colours. */
.ia-kb-article .card-body {
    padding: 1.5rem 1.75rem;
    line-height: 1.65;
}

.ia-kb-article h2 {
    margin: 2rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ia-border);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ia-charcoal);
    scroll-margin-top: 1rem;
}

.ia-kb-article h3 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ia-charcoal);
    scroll-margin-top: 1rem;
}

.ia-kb-article table {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.ia-kb-article th,
.ia-kb-article td {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--ia-border);
    vertical-align: top;
    text-align: left;
}

.ia-kb-article th {
    background: var(--ia-head-bg);
    color: var(--ia-charcoal);
    font-weight: 600;
}

.ia-kb-article code {
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.25rem;
    background: var(--ia-bg);
    color: var(--ia-charcoal);
    font-size: 0.8125rem;
}

.ia-kb-article blockquote {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--ia-border);
    background: var(--ia-head-bg);
    border-radius: 0 var(--ia-radius) var(--ia-radius) 0;
}

.ia-kb-article .markdown-alert {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ia-note-border);
    border-radius: var(--ia-radius);
    background: var(--ia-note-bg);
}

.ia-kb-article .markdown-alert > :last-child {
    margin-bottom: 0;
}

.ia-kb-article .markdown-alert-title {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: var(--ia-charcoal);
}

.ia-kb-article .markdown-alert-warning,
.ia-kb-article .markdown-alert-caution {
    border-color: var(--ia-red);
}

.ia-kb-shot {
    margin: 1rem 0 1.25rem;
    text-align: center;
}

/* In the text a screenshot is at most 28rem tall (a tall one, the sidebar, stays narrow) and centred; choosing it
   shows it whole. */
.ia-kb-shot img {
    max-width: 100%;
    max-height: 28rem;
    object-fit: contain;
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow);
}

.ia-kb-shot a {
    cursor: zoom-in;
}

/* A screenshot enlarged (js/knowledge-base.js): nearly the whole window, the picture fitted inside it. */
.ia-kb-shot-modal .modal-dialog {
    max-width: min(94vw, 1800px);
}

.ia-kb-shot-modal .modal-header {
    padding: 0.625rem 1rem;
}

.ia-kb-shot-modal .modal-body {
    padding: 0.75rem;
    background: var(--ia-bg);
    text-align: center;
}

.ia-kb-shot-modal .modal-body img {
    max-width: 100%;
    max-height: calc(100dvh - 9rem);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    object-fit: contain;
    cursor: zoom-out;
}

.ia-kb-shot figcaption {
    margin-top: 0.375rem;
    color: var(--ia-muted);
    font-size: 0.8125rem;
}

.ia-kb-shot-pending {
    padding: 1.5rem 1rem;
    border: 1px dashed var(--ia-border);
    border-radius: var(--ia-radius);
    color: var(--ia-muted);
    text-align: center;
    font-size: 0.875rem;
}

.ia-kb-pager {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.ia-kb-pager a {
    flex: 1;
    padding: 0.75rem 1rem;
    color: var(--ia-charcoal);
    text-decoration: none;
    font-weight: 500;
}

.ia-kb-pager a:hover {
    box-shadow: var(--ia-shadow-lg);
}

.ia-kb-pager small {
    display: block;
    color: var(--ia-muted);
    font-weight: 400;
}

.ia-kb-pager .ia-kb-pager-next {
    text-align: right;
}

.ia-kb-toc {
    position: sticky;
    top: 1rem;
}

.ia-kb-toc a {
    display: block;
    padding: 0.1875rem 0;
    color: var(--ia-text);
    text-decoration: none;
    font-size: 0.8125rem;
}

.ia-kb-toc a:hover {
    color: var(--ia-dark);
}
