/* Project-owned layout helpers and accessible dialog, panel, and toast styling. */
:root {
    --ui-space: .25rem;
    --ui-primary: #356ac3;
    --ui-secondary: #596579;
    --ui-success: #218838;
    --ui-warning: #e9a321;
    --ui-danger: #c83349;
    --ui-info: #138496;
    --ui-dark: #202638;
    --ui-border: rgba(120, 135, 160, .35);
}

*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ui-scroll-locked { overflow: hidden !important; }

.container { width: min(100% - 2rem, 1200px); margin-inline: auto; }
.container-fluid { width: 100%; padding-inline: 1rem; }
.row { display: flex; flex-wrap: wrap; margin-inline: -.5rem; row-gap: 1rem; }
.row > [class*="col-"] { padding-inline: .5rem; min-width: 0; }
.col { flex: 1 0 0%; }
.col-6 { width: 50%; }
.col-12 { width: 100%; }
@media (min-width: 768px) {
    .col-md-2 { width: 16.6667%; }
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.3333%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.6667%; }
    .col-md-12 { width: 100%; }
    .col-lg-4 { width: 33.3333%; }
    .col-lg-8 { width: 66.6667%; }
    .col-lg-10 { width: 83.3333%; }
}

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.g-0 { gap: 0 !important; }
.g-2 { gap: .5rem !important; }
.g-3 { gap: 1rem !important; }
.g-4 { gap: 1.5rem !important; }
.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.overflow-auto { overflow: auto !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }
.start-50 { left: 50% !important; }
.top-50 { top: 50% !important; }
.translate-middle { transform: translate(-50%, -50%) !important; }
.sticky-top { position: sticky; top: 0; z-index: 20; }
.float-none { float: none !important; }

.m-2 { margin: .5rem !important; }
.m-3 { margin: 1rem !important; }
.m-auto { margin: auto !important; }
.mx-2 { margin-inline: .5rem !important; }
.mx-3 { margin-inline: 1rem !important; }
.mx-auto { margin-inline: auto !important; }
.my-3 { margin-block: 1rem !important; }
.my-4 { margin-block: 1.5rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.pt-3 { padding-top: 1rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
.px-0 { padding-inline: 0 !important; }
.px-1 { padding-inline: .25rem !important; }
.px-3 { padding-inline: 1rem !important; }
.px-4 { padding-inline: 1.5rem !important; }
.px-5 { padding-inline: 3rem !important; }
.py-2 { padding-block: .5rem !important; }
.py-3 { padding-block: 1rem !important; }
.py-4 { padding-block: 1.5rem !important; }
.py-5 { padding-block: 3rem !important; }
@media (min-width: 768px) {
    .mb-md-0 { margin-bottom: 0 !important; }
    .flex-sm-row { flex-direction: row !important; }
    .justify-content-md-end { justify-content: flex-end !important; }
    .text-md-start { text-align: left !important; }
    .d-sm-flex { display: flex !important; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.5rem; padding: .55rem 1rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none; transition: filter .16s ease, transform .16s ease, background-color .16s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: 3px solid rgba(68, 143, 255, .6); outline-offset: 2px; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--ui-primary); }
.btn-secondary { color: #fff; background: var(--ui-secondary); }
.btn-success { color: #fff; background: var(--ui-success); }
.btn-warning { color: #241b05; background: #ffc247; }
.btn-danger { color: #fff; background: var(--ui-danger); }
.btn-info { color: #fff; background: var(--ui-info); }
.btn-light { color: #252a35; background: #f4f6fa; }
.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-warning, .btn-outline-danger, .btn-outline-info, .btn-outline-light { color: inherit; background: transparent; border-color: currentColor; }
.btn-outline-primary { color: #8fb7ff; }
.btn-outline-secondary { color: #c5ccda; }
.btn-outline-success { color: #76dfa0; }
.btn-outline-warning { color: #ffd16b; }
.btn-outline-danger { color: #ff899a; }
.btn-outline-info { color: #75dce6; }
.btn-outline-light { color: #fff; }
.btn-sm { min-height: 2rem; padding: .35rem .7rem; font-size: .875rem; }
.btn-lg { min-height: 3rem; padding: .75rem 1.25rem; font-size: 1.1rem; }
.btn-close { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 50%; color: currentColor; background: transparent; font-size: 1.5rem; line-height: 1; }
.btn-close::before { content: "×"; }
.btn-close-white { color: #fff; }

.form-control, .form-select { display: block; width: 100%; min-height: 2.6rem; padding: .55rem .75rem; border: 1px solid var(--ui-border); border-radius: .55rem; color: inherit; background: rgba(255,255,255,.96); }
.form-control[type="range"] { padding-inline: 0; }
.form-select-sm { min-height: 2rem; padding-block: .3rem; font-size: .875rem; }
.form-control:disabled, .form-select:disabled { opacity: .6; }
.form-label { display: inline-block; margin-bottom: .4rem; font-weight: 600; }
.form-check { display: flex; align-items: center; gap: .55rem; min-height: 1.5rem; margin-bottom: .5rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--ui-primary); }
.form-check-label { cursor: pointer; }
.form-switch .form-check-input { width: 2.2rem; height: 1.2rem; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.text-decoration-none { text-decoration: none !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fst-italic { font-style: italic !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.lead { font-size: 1.2rem; font-weight: 350; }
.display-1 { font-size: clamp(3rem, 9vw, 6rem); font-weight: 300; line-height: 1.1; }
.display-3 { font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 300; line-height: 1.1; }
.display-4 { font-size: clamp(2.1rem, 6vw, 3.5rem); font-weight: 300; line-height: 1.1; }
.display-5 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 300; line-height: 1.1; }
.display-6 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 300; line-height: 1.1; }
.text-primary { color: #76a7ff !important; }
.text-secondary, .text-muted { color: #a9b2c2 !important; }
.text-success { color: #67d293 !important; }
.text-warning { color: #ffd16b !important; }
.text-danger { color: #ff7187 !important; }
.text-info { color: #79dce8 !important; }
.text-light, .text-white { color: #f8f9fc !important; }
.text-dark { color: #202634 !important; }
.text-white-50 { color: rgba(255,255,255,.62) !important; }
.bg-primary { background-color: var(--ui-primary) !important; }
.bg-secondary { background-color: #626d80 !important; }
.bg-success { background-color: var(--ui-success) !important; }
.bg-warning { background-color: #ffc247 !important; }
.bg-danger { background-color: var(--ui-danger) !important; }
.bg-info { background-color: var(--ui-info) !important; }
.bg-dark { background-color: #202638 !important; }
.bg-light, .bg-white { background-color: #f5f7fb !important; }
.bg-transparent { background-color: transparent !important; }
.bg-gradient { background-image: linear-gradient(180deg, rgba(255,255,255,.12), transparent) !important; }
.bg-opacity-10 { --local-bg-alpha: .1; }
.bg-opacity-25 { --local-bg-alpha: .25; }
.bg-opacity-50 { --local-bg-alpha: .5; }
.bg-opacity-75 { --local-bg-alpha: .75; }
.bg-opacity-95 { --local-bg-alpha: .95; }
.text-bg-warning { color: #241b05; background: #ffc247; }
.font-monospace { font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.bg-white-50 { background-color: rgba(255,255,255,.5) !important; }
.bg-dark.bg-opacity-10 { background-color: rgba(32,38,56,.1) !important; }
.bg-dark.bg-opacity-25 { background-color: rgba(32,38,56,.25) !important; }
.bg-dark.bg-opacity-50 { background-color: rgba(32,38,56,.5) !important; }
.bg-dark.bg-opacity-75 { background-color: rgba(32,38,56,.75) !important; }
.bg-dark.bg-opacity-95 { background-color: rgba(32,38,56,.95) !important; }
.bg-primary.bg-opacity-10 { background-color: rgba(53,106,195,.1) !important; }
.bg-primary.bg-opacity-25 { background-color: rgba(53,106,195,.25) !important; }
.bg-primary.bg-opacity-50 { background-color: rgba(53,106,195,.5) !important; }
.bg-primary.bg-opacity-75 { background-color: rgba(53,106,195,.75) !important; }
.bg-secondary.bg-opacity-10 { background-color: rgba(98,109,128,.1) !important; }
.bg-secondary.bg-opacity-25 { background-color: rgba(98,109,128,.25) !important; }
.bg-secondary.bg-opacity-50 { background-color: rgba(98,109,128,.5) !important; }
.bg-secondary.bg-opacity-75 { background-color: rgba(98,109,128,.75) !important; }
.bg-success.bg-opacity-10 { background-color: rgba(33,136,56,.1) !important; }
.bg-success.bg-opacity-25 { background-color: rgba(33,136,56,.25) !important; }
.bg-warning.bg-opacity-10 { background-color: rgba(255,194,71,.1) !important; }
.bg-warning.bg-opacity-25 { background-color: rgba(255,194,71,.25) !important; }
.bg-danger.bg-opacity-10 { background-color: rgba(200,51,73,.1) !important; }
.bg-danger.bg-opacity-25 { background-color: rgba(200,51,73,.25) !important; }
.bg-info.bg-opacity-10 { background-color: rgba(19,132,150,.1) !important; }
.bg-info.bg-opacity-25 { background-color: rgba(19,132,150,.25) !important; }
.border { border: 1px solid var(--ui-border) !important; }
.border-0 { border: 0 !important; }
.border-2 { border-width: 2px !important; }
.border-3 { border-width: 3px !important; }
.border-4 { border-width: 4px !important; }
.border-bottom { border-bottom: 1px solid var(--ui-border) !important; }
.border-secondary { border-color: #626d80 !important; }
.border-dark { border-color: #202638 !important; }
.border-light, .border-white { border-color: rgba(255,255,255,.5) !important; }
.rounded { border-radius: .5rem !important; }
.rounded-3 { border-radius: 1rem !important; }
.rounded-4 { border-radius: 1.25rem !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 999px !important; }
.shadow-sm { box-shadow: 0 .2rem .5rem rgba(0,0,0,.15) !important; }
.shadow { box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.18) !important; }
.shadow-lg { box-shadow: 0 1rem 2rem rgba(0,0,0,.25) !important; }
.opacity-75 { opacity: .75 !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.card { min-width: 0; border: 1px solid var(--ui-border); border-radius: .9rem; background: rgba(255,255,255,.06); overflow: hidden; }
.card-body { padding: 1rem; }
.card-title { margin: 0 0 .5rem; }
.card-subtitle { margin: -.25rem 0 .6rem; }
.card-img-top { display: block; width: 100%; height: auto; }
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .25em .55em; border-radius: 999px; background: #596579; color: #fff; font-size: .8em; font-weight: 650; line-height: 1; }
.alert { position: relative; margin-block: 1rem; padding: .85rem 1rem; border: 1px solid var(--ui-border); border-radius: .75rem; }
.alert-danger, .alert-soft-danger { color: #812438; background: #ffe5e9; border-color: #ffc2cb; }
.alert-warning { color: #624608; background: #fff3cd; border-color: #ffdf82; }
.alert-info { color: #145c68; background: #d7f5f7; border-color: #9fe3eb; }
.alert-light { color: #343a40; background: #f5f7fb; }
.list-unstyled { padding-left: 0; list-style: none; }
.list-group { display: flex; flex-direction: column; padding: 0; margin: 0; list-style: none; }
.list-group-item { display: block; padding: .65rem .9rem; border: 1px solid var(--ui-border); background: transparent; color: inherit; }
.list-group-item + .list-group-item { border-top: 0; }
.list-group-flush .list-group-item { border-inline: 0; }
.progress { height: .7rem; overflow: hidden; border-radius: 999px; background: rgba(128,140,160,.24); }
.progress-bar { height: 100%; background: var(--ui-primary); transition: width .2s ease; }
.ratio { position: relative; width: 100%; }
.ratio::before { display: block; padding-top: var(--ratio, 100%); content: ""; }
.ratio-16x9 { --ratio: 56.25%; }
.ratio > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.spinner-border, .spinner-grow { display: inline-block; width: 1.2rem; height: 1.2rem; border: .16em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .75s linear infinite; }
.spinner-grow { border: 0; background: currentColor; opacity: .5; animation-name: ui-grow; }
.spinner-border-sm { width: .9rem; height: .9rem; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-grow { 50% { transform: scale(.65); opacity: 1; } }

.nav-tabs { display: flex; flex-wrap: wrap; gap: .35rem; border-bottom: 1px solid var(--ui-border); }
.nav-tabs .nav-link { padding: .6rem .9rem; border: 0; border-bottom: 3px solid transparent; color: inherit; background: transparent; text-decoration: none; }
.nav-tabs .nav-link.active { border-color: var(--ui-primary); color: #fff; }
.tab-pane[hidden] { display: none !important; }
.tab-pane.active { display: block; }
.table-responsive { max-width: 100%; overflow: auto; }
.table { width: 100%; border-collapse: collapse; color: inherit; }
.table th, .table td { padding: .55rem .65rem; border-bottom: 1px solid var(--ui-border); text-align: left; }
.table-hover tbody tr:hover { background: rgba(120,140,170,.12); }
.table-light { color: #202638; background: #f0f2f5; }
.table-sm th, .table-sm td { padding: .35rem .5rem; }

.ui-backdrop { position: fixed; inset: 0; z-index: 1090; opacity: 0; background: rgba(7, 10, 18, .68); transition: opacity .18s ease; }
.ui-backdrop.is-open { opacity: 1; }
.modal { position: fixed; inset: 0; z-index: 1100; display: none; align-items: center; justify-content: center; overflow: auto; padding: 1rem; }
.modal.is-open { display: flex; }
.modal-dialog { position: relative; z-index: 1; width: min(100%, 34rem); margin: auto; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 2rem); }
.modal-lg { width: min(100%, 58rem); }
.modal-content { width: 100%; border: 1px solid var(--ui-border); border-radius: 1rem; background: #fff; color: #222; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.35); overflow: hidden; }
.modal-header, .modal-footer { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; }
.modal-header { justify-content: space-between; border-bottom: 1px solid var(--ui-border); }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--ui-border); }
.modal-body { padding: 1.25rem; }
.modal-title { margin: 0; font-size: 1.2rem; }
.modal-dialog-centered .modal-content { margin-block: auto; }

.offcanvas { position: fixed; z-index: 1100; display: flex; flex-direction: column; max-width: 100%; max-height: 100%; visibility: hidden; background: #fff; color: #222; box-shadow: 0 1rem 3rem rgba(0,0,0,.3); transition: transform .24s ease, visibility .24s ease; }
.offcanvas.is-open { visibility: visible; }
.offcanvas-end { inset: 0 0 0 auto; width: min(100%, 30rem); transform: translateX(100%); }
.offcanvas-start { inset: 0 auto 0 0; width: min(100%, 30rem); transform: translateX(-100%); }
.offcanvas-bottom { inset: auto 0 0; width: 100%; max-height: 100dvh; transform: translateY(100%); }
.offcanvas.is-open { transform: none; }
.offcanvas-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.offcanvas-title { margin: 0; }
.offcanvas-body { flex: 1; min-height: 0; padding: 1.25rem; overflow: auto; }

.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; z-index: 30; top: calc(100% + .35rem); right: 0; min-width: 12rem; padding: .4rem; border: 1px solid var(--ui-border); border-radius: .75rem; background: #fff; color: #222; box-shadow: 0 .75rem 2rem rgba(0,0,0,.2); }
.dropdown-menu.is-open { display: block; }
.dropdown-item { display: block; width: 100%; padding: .55rem .75rem; border: 0; border-radius: .4rem; color: inherit; background: transparent; text-align: left; text-decoration: none; }
.dropdown-item:hover { background: rgba(70,110,180,.12); }
.dropdown-divider { height: 1px; margin: .35rem 0; border: 0; background: var(--ui-border); }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-toggle::after { display: inline-block; margin-left: .45em; vertical-align: .15em; content: ""; border: .3em solid transparent; border-top-color: currentColor; border-bottom: 0; }
.collapse[hidden] { display: none !important; }
.collapse:not(.is-open) { display: none; }
.collapse.is-open { display: block; }
.accordion-item { border-bottom: 1px solid var(--ui-border); }
.accordion-button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: .9rem 1rem; border: 0; color: inherit; background: transparent; text-align: left; font-weight: 650; }
.accordion-button::after { content: "+"; font-size: 1.25rem; }
.accordion-button[aria-expanded="true"]::after { content: "−"; }
.accordion-body { padding: .75rem 1rem 1rem; }

.toast-container { position: fixed; z-index: 1200; top: 1rem; right: 1rem; display: grid; gap: .65rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: .85rem; color: #fff; background: #31384a; box-shadow: 0 .8rem 2rem rgba(0,0,0,.28); opacity: 0; transform: translateY(-.5rem); transition: opacity .18s ease, transform .18s ease; pointer-events: auto; }
.toast.is-open { opacity: 1; transform: translateY(0); }
.toast-body { flex: 1; }
.toast.bg-success { background: #247c4a; }
.toast.bg-warning { color: #2b2108; background: #f1bc4a; }
.toast.bg-danger { background: #a52c41; }
.toast.bg-info { background: #16798a; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
