/*
 * LibraRS on Bootstrap 5.3: theme, layout and the compatibility layer for
 * the Bootstrap 3 / Homer / AdminLTE markup the templates still use.
 *
 * Themes: <html data-bs-theme="light|dark" data-l5-accent="libra|navy|graphite">,
 * set by static/scripts/libra5.js from the user's choice (localStorage).
 */

/* ------------------------------------------------------------------ tokens */

:root {
    --l5-font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --l5-sidebar-width: 256px;
    --l5-topbar-height: 60px;
    --l5-radius: .625rem;
    --l5-accent: #0b90b0;
    --l5-accent-rgb: 11, 144, 176;
    --l5-accent-hover: #097a96;
    --l5-accent-soft: rgba(11, 144, 176, .12);
    --l5-sidebar-bg: #0f2a36;
    --l5-sidebar-color: #b9cbd3;
    --l5-sidebar-active: #ffffff;
    --l5-sidebar-hover-bg: rgba(255, 255, 255, .06);
    --l5-body-bg: #f3f5f8;
    --l5-card-bg: #ffffff;
    --l5-card-border: #e3e7ed;
    --l5-card-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --l5-muted: #667085;
    --l5-table-head-bg: #f8fafc;
}

[data-l5-accent="navy"] {
    --l5-accent: #2f55d4;
    --l5-accent-rgb: 47, 85, 212;
    --l5-accent-hover: #2546b4;
    --l5-accent-soft: rgba(47, 85, 212, .12);
    --l5-sidebar-bg: #111a33;
    --l5-sidebar-color: #b8c1dc;
}

[data-l5-accent="graphite"] {
    --l5-accent: #475467;
    --l5-accent-rgb: 71, 84, 103;
    --l5-accent-hover: #344054;
    --l5-accent-soft: rgba(71, 84, 103, .12);
    --l5-sidebar-bg: #1d2939;
    --l5-sidebar-color: #c3c9d2;
}

[data-bs-theme="dark"] {
    --l5-body-bg: #0f141a;
    --l5-card-bg: #161c24;
    --l5-card-border: #263040;
    --l5-card-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --l5-muted: #98a2b3;
    --l5-table-head-bg: #1b2230;
    --l5-sidebar-bg: #0b1016;
    --bs-body-bg: #0f141a;
    --bs-body-bg-rgb: 15, 20, 26;
    --bs-tertiary-bg: #1b2230;
}

[data-bs-theme="dark"][data-l5-accent="libra"] { --l5-accent: #22b3d6; --l5-accent-rgb: 34, 179, 214; --l5-accent-hover: #4cc3e0; }
[data-bs-theme="dark"][data-l5-accent="navy"] { --l5-accent: #6e8cf0; --l5-accent-rgb: 110, 140, 240; --l5-accent-hover: #8ea6f4; }
[data-bs-theme="dark"][data-l5-accent="graphite"] { --l5-accent: #98a2b3; --l5-accent-rgb: 152, 162, 179; --l5-accent-hover: #b3bbc8; }

:root, [data-bs-theme] {
    --bs-primary: var(--l5-accent);
    --bs-primary-rgb: var(--l5-accent-rgb);
    --bs-link-color: var(--l5-accent);
    --bs-link-color-rgb: var(--l5-accent-rgb);
    --bs-link-hover-color: var(--l5-accent-hover);
    --bs-link-hover-color-rgb: var(--l5-accent-rgb);
    --bs-body-font-family: var(--l5-font);
    --bs-body-font-size: .9rem;
    --bs-border-radius: .5rem;
}

/* ------------------------------------------------------------------ base */

body.l5 {
    background: var(--l5-body-bg);
    font-family: var(--l5-font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; }

.btn-primary {
    --bs-btn-bg: var(--l5-accent);
    --bs-btn-border-color: var(--l5-accent);
    --bs-btn-hover-bg: var(--l5-accent-hover);
    --bs-btn-hover-border-color: var(--l5-accent-hover);
    --bs-btn-active-bg: var(--l5-accent-hover);
    --bs-btn-active-border-color: var(--l5-accent-hover);
    --bs-btn-disabled-bg: var(--l5-accent);
    --bs-btn-disabled-border-color: var(--l5-accent);
    --bs-btn-focus-shadow-rgb: var(--l5-accent-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--l5-accent);
    --bs-btn-border-color: var(--l5-accent);
    --bs-btn-hover-bg: var(--l5-accent);
    --bs-btn-hover-border-color: var(--l5-accent);
    --bs-btn-active-bg: var(--l5-accent);
    --bs-btn-active-border-color: var(--l5-accent);
}

.btn { font-weight: 500; }

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--l5-accent-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--l5-accent-rgb), .18);
}

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

.nav-pills { --bs-nav-pills-link-active-bg: var(--l5-accent); }
.pagination { --bs-pagination-active-bg: var(--l5-accent); --bs-pagination-active-border-color: var(--l5-accent); --bs-pagination-color: var(--l5-accent); }
.text-primary { color: var(--l5-accent) !important; }
.bg-primary { background-color: var(--l5-accent) !important; }

.coloricon { color: var(--l5-accent); }

/* ------------------------------------------------------------------ layout */

.l5-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--l5-sidebar-width);
    background: var(--l5-sidebar-bg);
    color: var(--l5-sidebar-color);
    transition: transform .2s ease;
}

.l5-brand {
    display: flex;
    align-items: center;
    height: var(--l5-topbar-height);
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

/* the logo is dark text on light: inverted, the hue turned back to keep the brand blue */
.l5-brand img { height: 28px; filter: invert(1) hue-rotate(180deg) brightness(1.15); }

.l5-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.l5-user img, .l5-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.l5-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--l5-accent);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
}

.l5-user-name { color: var(--l5-sidebar-active); font-weight: 600; font-size: .875rem; line-height: 1.2; }
.l5-user-org { font-size: .75rem; opacity: .75; text-transform: uppercase; letter-spacing: .03em; }

.l5-nav { flex: 1; overflow-y: auto; padding: .75rem .625rem; }
.l5-nav ul { list-style: none; margin: 0; padding: 0; }

.l5-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    border-radius: .5rem;
    color: var(--l5-sidebar-color);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}

.l5-nav a:hover { background: var(--l5-sidebar-hover-bg); color: var(--l5-sidebar-active); }
.l5-nav a.active { background: rgba(var(--l5-accent-rgb), .22); color: var(--l5-sidebar-active); }
.l5-nav a > .fa { width: 1.1rem; text-align: center; font-size: 1rem; opacity: .9; color: inherit; }

.l5-nav .l5-group > a::after {
    content: "\f105";
    font-family: FontAwesome;
    margin-left: auto;
    transition: transform .15s ease;
    opacity: .6;
}

.l5-nav .l5-group.open > a::after { transform: rotate(90deg); }
.l5-nav .l5-group > ul { display: none; padding: .15rem 0 .35rem 1.85rem; }
.l5-nav .l5-group.open > ul { display: block; }
.l5-nav .l5-group ul a { padding: .4rem .75rem; font-weight: 400; font-size: .84rem; }
.l5-nav .l5-group ul .l5-group > ul { padding-left: .9rem; }

.l5-version { padding: .75rem 1.25rem; font-size: .72rem; opacity: .5; }

.l5-main { margin-left: var(--l5-sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin .2s ease; }

.l5-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--l5-topbar-height);
    padding: 0 1.5rem;
    background: rgba(var(--bs-body-bg-rgb), .85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--l5-card-border);
}

.l5-title { font-size: 1.15rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.l5-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 1.1rem;
}

.l5-icon-btn:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.l5-icon-btn img { width: 20px; border-radius: 2px; }

.l5-content { flex: 1; padding: 1.5rem; }
.l5-footer { padding: 1rem 1.5rem; color: var(--l5-muted); font-size: .78rem; }

.l5-theme-swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; margin-right: .5rem; vertical-align: -1px; }

body.l5-sidebar-hidden .l5-sidebar { transform: translateX(-100%); }
body.l5-sidebar-hidden .l5-main { margin-left: 0; }

.l5-backdrop { display: none; }

@media (max-width: 991.98px) {
    .l5-sidebar { transform: translateX(-100%); }
    .l5-main { margin-left: 0; }
    body.l5-sidebar-open .l5-sidebar { transform: none; }
    body.l5-sidebar-open .l5-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0, 0, 0, .4); }
    .l5-content { padding: 1rem; }
}

/* messages */
.l5-messages .alert { border-radius: var(--l5-radius); }

/* ------------------------------------------------------------------ cards: hpanel (Homer), box (AdminLTE), panel (Bootstrap 3) */

.hpanel, .box, .panel {
    background: var(--l5-card-bg);
    border: 1px solid var(--l5-card-border);
    border-radius: var(--l5-radius);
    box-shadow: var(--l5-card-shadow);
    margin-bottom: 1.5rem;
}

.hpanel .hpanel, .box .box, .hpanel .box, .box .hpanel, .hpanel .panel, .box .panel {
    box-shadow: none;
    margin-bottom: 1rem;
}

/* a card that only wraps another card */
.hpanel > .box-body:only-child > .hpanel:only-child, .hpanel > .panel-body:only-child > .hpanel:only-child { border: 0; }

.panel-heading, .box-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--l5-card-border);
    font-weight: 600;
}

.box-header .box-title, .panel-title { margin: 0; font-size: 1rem; font-weight: 600; }
.panel-tools, .box-tools { order: 2; margin-left: auto; display: flex; align-items: center; gap: .6rem; font-weight: 400; color: var(--l5-muted); font-size: .82rem; }
.panel-tools a, .box-tools a { color: var(--l5-muted); cursor: pointer; }
.panel-tools a:hover { color: var(--bs-body-color); }

.panel-body, .box-body { padding: 1.25rem; display: flow-root; }
.panel-footer, .box-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--l5-card-border); }
.panel-collapse > .panel-heading { border-bottom: 0; }

/* Bootstrap 3 floats its columns, so templates put columns straight into a
   card body or another column, without a .row; Bootstrap 5 columns need one */
.panel-body > [class^="col-"], .panel-body > [class*=" col-"],
.box-body > [class^="col-"], .box-body > [class*=" col-"],
[class^="col-"] > [class^="col-"], [class^="col-"] > [class*=" col-"],
[class*=" col-"] > [class^="col-"], [class*=" col-"] > [class*=" col-"] { float: left; position: relative; min-height: 1px; padding: 0 .75rem; }
[class^="col-"], [class*=" col-"] { display: flow-root; }
.row > [class^="col-"], .row > [class*=" col-"] { float: none; }
/* a tab pane that is itself a column and holds columns without a .row would
   indent its cards one gutter more than the tabs above it */
.row.tab-content > .tab-pane:has(> [class^="col-"], > [class*=" col-"]),
.row.tab-content > .tab-pane > [class*="col-"]:has(> [class^="col-"], > [class*=" col-"]) { padding-left: 0; padding-right: 0; }

.panel-default > .panel-heading { background: var(--bs-tertiary-bg); }
.panel-group .panel + .panel { margin-top: .5rem; }
.well { background: var(--bs-tertiary-bg); border: 1px solid var(--l5-card-border); border-radius: var(--l5-radius); padding: 1rem; margin-bottom: 1rem; }

/* ------------------------------------------------------------------ grid: Bootstrap 3 names */

.col-xs-1 { flex: 0 0 auto; width: 8.33333333%; } .col-xs-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; } .col-xs-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.66666667%; } .col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.33333333%; } .col-xs-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; } .col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.66666667%; } .col-xs-12, .col-sx-12 { flex: 0 0 auto; width: 100%; }

/* the col-xs-* rules above come after Bootstrap 5, so its responsive columns
   are declared again here: col-xs-12 col-md-6 is half width from md up */
@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 auto; width: 8.33333333%; } .col-sm-2 { flex: 0 0 auto; width: 16.66666667%; } .col-sm-3 { flex: 0 0 auto; width: 25%; } .col-sm-4 { flex: 0 0 auto; width: 33.33333333%; } .col-sm-5 { flex: 0 0 auto; width: 41.66666667%; } .col-sm-6 { flex: 0 0 auto; width: 50%; } .col-sm-7 { flex: 0 0 auto; width: 58.33333333%; } .col-sm-8 { flex: 0 0 auto; width: 66.66666667%; } .col-sm-9 { flex: 0 0 auto; width: 75%; } .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; } .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; } .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.33333333%; } .col-md-2 { flex: 0 0 auto; width: 16.66666667%; } .col-md-3 { flex: 0 0 auto; width: 25%; } .col-md-4 { flex: 0 0 auto; width: 33.33333333%; } .col-md-5 { flex: 0 0 auto; width: 41.66666667%; } .col-md-6 { flex: 0 0 auto; width: 50%; } .col-md-7 { flex: 0 0 auto; width: 58.33333333%; } .col-md-8 { flex: 0 0 auto; width: 66.66666667%; } .col-md-9 { flex: 0 0 auto; width: 75%; } .col-md-10 { flex: 0 0 auto; width: 83.33333333%; } .col-md-11 { flex: 0 0 auto; width: 91.66666667%; } .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 auto; width: 8.33333333%; } .col-lg-2 { flex: 0 0 auto; width: 16.66666667%; } .col-lg-3 { flex: 0 0 auto; width: 25%; } .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; } .col-lg-5 { flex: 0 0 auto; width: 41.66666667%; } .col-lg-6 { flex: 0 0 auto; width: 50%; } .col-lg-7 { flex: 0 0 auto; width: 58.33333333%; } .col-lg-8 { flex: 0 0 auto; width: 66.66666667%; } .col-lg-9 { flex: 0 0 auto; width: 75%; } .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; } .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; } .col-lg-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 auto; width: 8.33333333%; } .col-xl-2 { flex: 0 0 auto; width: 16.66666667%; } .col-xl-3 { flex: 0 0 auto; width: 25%; } .col-xl-4 { flex: 0 0 auto; width: 33.33333333%; } .col-xl-5 { flex: 0 0 auto; width: 41.66666667%; } .col-xl-6 { flex: 0 0 auto; width: 50%; } .col-xl-7 { flex: 0 0 auto; width: 58.33333333%; } .col-xl-8 { flex: 0 0 auto; width: 66.66666667%; } .col-xl-9 { flex: 0 0 auto; width: 75%; } .col-xl-10 { flex: 0 0 auto; width: 83.33333333%; } .col-xl-11 { flex: 0 0 auto; width: 91.66666667%; } .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 576px) {
    .col-sm-offset-1 { margin-left: 8.333333%; } .col-sm-offset-2 { margin-left: 16.666667%; }
    .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-4 { margin-left: 33.333333%; }
}
@media (min-width: 768px) {
    .col-md-offset-1 { margin-left: 8.333333%; } .col-md-offset-2 { margin-left: 16.666667%; }
    .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.333333%; }
}
@media (min-width: 992px) {
    .col-lg-offset-1 { margin-left: 8.333333%; } .col-lg-offset-2 { margin-left: 16.666667%; }
    .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-4 { margin-left: 33.333333%; }
}

@media (max-width: 575.98px) { .hidden-xs { display: none !important; } }
@media (min-width: 576px) and (max-width: 767.98px) { .hidden-sm { display: none !important; } }
@media (min-width: 768px) and (max-width: 991.98px) { .hidden-md { display: none !important; } }
@media (min-width: 992px) { .hidden-lg { display: none !important; } }
.hidden { display: none !important; }
.show-inline { display: inline !important; }

/* ------------------------------------------------------------------ helpers: Bootstrap 3 names */

.pull-right { float: right !important; }
.pull-left { float: left !important; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.img-responsive { display: block; max-width: 100%; height: auto; }
.img-circle { border-radius: 50%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid; border-right: 4px solid transparent; border-left: 4px solid transparent; }
.text-color { color: inherit; }
.m-b { margin-bottom: 15px; } .m-t { margin-top: 15px; } .m-t-md { margin-top: 20px; } .m-b-md { margin-bottom: 20px; }
.font-bold { font-weight: 600; } .font-extra-bold { font-weight: 700; } .font-uppercase { text-transform: uppercase; }

/* buttons */
.btn-default {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-bg: var(--l5-card-bg);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-body-color);
    --bs-btn-hover-bg: var(--bs-tertiary-bg);
    --bs-btn-hover-border-color: var(--bs-border-color);
    --bs-btn-active-color: var(--bs-body-color);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-border-color: var(--bs-border-color);
}
.btn-xs { --bs-btn-padding-y: .1rem; --bs-btn-padding-x: .4rem; --bs-btn-font-size: .75rem; --bs-btn-border-radius: .3rem; }
.btn-flat { box-shadow: none; }
.btn-block { display: block; width: 100%; }
.btn-block + .btn-block { margin-top: .5rem; }

/* labels -> badges */
.label { display: inline-block; padding: .3em .55em; font-size: .75em; font-weight: 600; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .35rem; background: var(--bs-secondary); margin: 1px; }
.label-default { background: #6c757d; } .label-primary { background: var(--l5-accent); }
.label-success { background: var(--bs-success); } .label-info { background: var(--bs-info); color: #000; }
.label-warning { background: var(--bs-warning); color: #000; } .label-danger { background: var(--bs-danger); }

/* forms (django-bootstrap3 renders this markup) */
.form-group { margin-bottom: 1rem; }
.control-label { display: inline-block; margin-bottom: .35rem; font-weight: 500; }
.help-block { display: block; margin-top: .25rem; color: var(--l5-muted); font-size: .82em; }
.has-error .form-control { border-color: var(--bs-danger); }
.has-error .help-block, .has-error .control-label { color: var(--bs-danger); }
.has-success .form-control { border-color: var(--bs-success); }
.form-horizontal .form-group { display: flex; flex-wrap: wrap; margin-left: -.75rem; margin-right: -.75rem; }
.form-horizontal .form-group > [class*="col-"] { padding: 0 .75rem; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form-inline .form-group { margin-bottom: 0; }
.input-sm { min-height: calc(1.5em + .5rem + 2px); padding: .25rem .5rem; font-size: .82rem; border-radius: .35rem; }
select.form-control:not([multiple]):not([size]) { appearance: auto; }
.checkbox, .radio { margin-bottom: .5rem; }
.checkbox label, .radio label { font-weight: 400; display: inline-flex; align-items: center; gap: .4rem; }
.input-group-addon {
    display: flex; align-items: center; padding: .375rem .75rem; font-size: 1rem; line-height: 1.5;
    color: var(--bs-body-color); background: var(--bs-tertiary-bg); border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}
.input-group-btn { display: flex; }
.input-group > .input-group-addon:not(:last-child), .input-group > .input-group-btn:not(:last-child) > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-addon:not(:first-child), .input-group > .input-group-btn:not(:first-child) > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

/* glyphicons of django-bootstrap3 ({% bootstrap_icon %}) drawn with Font Awesome */
.glyphicon { display: inline-block; font: normal normal normal 14px/1 FontAwesome; }
.glyphicon-star { display: none; }
.glyphicon-play::before { content: "\f04b"; }
.glyphicon-trash::before { content: "\f1f8"; }
.glyphicon-refresh::before, .glyphicon-repeat::before { content: "\f021"; }
.glyphicon-ok::before { content: "\f00c"; }
.glyphicon-remove::before { content: "\f00d"; }

/* tabs, collapse, modal: Bootstrap 3 state classes */
.fade.in { opacity: 1; }
.collapse.in { display: block; }
.nav-tabs > li > a { display: block; padding: .5rem 1rem; border: 1px solid transparent; border-top-left-radius: .5rem; border-top-right-radius: .5rem; margin-bottom: -1px; text-decoration: none; color: var(--l5-muted); }
.nav-tabs > li.active > a, .nav-tabs > li > a.active { color: var(--bs-body-color); background: var(--l5-card-bg); border-color: var(--bs-border-color) var(--bs-border-color) var(--l5-card-bg); }
.nav-tabs .nav-link.active { background: var(--l5-card-bg); border-bottom-color: var(--l5-card-bg); }
.nav-tabs .nav-link { color: var(--l5-muted); }
.close { float: right; padding: 0; background: transparent; border: 0; font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--bs-body-color); opacity: .5; }
.close:hover { opacity: .8; }
.modal-header .close { order: 2; margin-left: auto; }
.modal-content { border-radius: var(--l5-radius); border-color: var(--l5-card-border); }

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

.table { --bs-table-bg: transparent; margin-bottom: 0; vertical-align: middle; }
.table > thead > tr > th, .table > tfoot > tr > th {
    background: var(--l5-table-head-bg);
    color: var(--l5-muted);
    font-size: .76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.table-condensed > :not(caption) > * > * { padding: .35rem .55rem; }
table.dataTable tfoot .form-control, table.dataTable tfoot input, table.dataTable tfoot select { min-height: 0; padding: .2rem .45rem; font-size: .8rem; font-weight: 400; text-transform: none; letter-spacing: 0; width: 100%; }
.table-bordered { border-color: var(--l5-card-border); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--l5-accent-soft); }

/* DataTables 1.10 with its Bootstrap 3 integration */
div.dataTables_wrapper { padding-top: .25rem; overflow-x: auto; }
/* dataTables.bootstrap.js puts form-inline on the wrapper; its rows stack */
div.dataTables_wrapper.form-inline { display: block; }
div.dataTables_wrapper div.dataTables_length, div.dataTables_wrapper div.dataTables_filter, div.dataTables_wrapper div.dataTables_info { padding: .5rem 0; color: var(--l5-muted); font-size: .84rem; }
div.dataTables_wrapper div.dataTables_length select { display: inline-block; width: auto; }
div.dataTables_wrapper div.dataTables_filter { text-align: right; float: right; }
div.dataTables_wrapper div.dataTables_filter input { display: inline-block; width: auto; margin-left: .5rem; }
div.dataTables_wrapper div.dataTables_paginate { float: right; padding: .5rem 0; }
div.dataTables_wrapper div.dataTables_processing { background: var(--l5-card-bg); border: 1px solid var(--l5-card-border); border-radius: var(--l5-radius); box-shadow: var(--l5-card-shadow); padding: .75rem; }
.dataTables_wrapper .dt-buttons { display: inline-flex; gap: .35rem; margin: .25rem 1rem .5rem 0; float: left; }
.dataTables_wrapper .dt-button, .dataTables_wrapper a.dt-button, .dataTables_wrapper button.dt-button {
    background: var(--l5-card-bg) !important; border: 1px solid var(--bs-border-color) !important; border-radius: .4rem !important;
    color: var(--bs-body-color) !important; padding: .3rem .7rem !important; font-size: .8rem !important; margin: 0 !important; box-shadow: none !important;
}
.dataTables_wrapper .dt-button:hover { background: var(--bs-tertiary-bg) !important; }
.dataTables_wrapper .clear { clear: both; }
table.dataTable { border-collapse: collapse !important; margin: .5rem 0 !important; width: 100% !important; }
table.dataTable.no-footer { border-bottom: 1px solid var(--l5-card-border); }
table.dataTable tbody tr.selected > * { box-shadow: inset 0 0 0 9999px var(--l5-accent-soft); color: inherit; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; position: relative; padding-right: 1.6rem; }
table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::after {
    position: absolute; right: .55rem; bottom: auto; top: 50%; transform: translateY(-50%); display: block; font-family: FontAwesome; opacity: .35;
}
table.dataTable thead .sorting::after { content: "\f0dc"; }
table.dataTable thead .sorting_asc::after { content: "\f0de"; opacity: .85; }
table.dataTable thead .sorting_desc::after { content: "\f0dd"; opacity: .85; }

.pagination { display: flex; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.pagination > li > a, .pagination > li > span {
    display: block; padding: .3rem .65rem; border: 1px solid var(--bs-border-color); border-radius: .4rem;
    color: var(--bs-body-color); background: var(--l5-card-bg); text-decoration: none; font-size: .82rem;
}
.pagination > li > a:hover { background: var(--bs-tertiary-bg); }
.pagination > .active > a, .pagination > .active > span { background: var(--l5-accent); border-color: var(--l5-accent); color: #fff; }
.pagination > .disabled > a, .pagination > .disabled > span { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------------ plugins */

/* Select2 3.5 */
.select2-container .select2-choice, .select2-container-multi .select2-choices {
    min-height: calc(1.5em + .75rem + 2px); border: var(--bs-border-width) solid var(--bs-border-color) !important;
    border-radius: var(--bs-border-radius) !important; background: var(--bs-body-bg) !important; color: var(--bs-body-color);
    background-image: none !important; box-shadow: none !important;
}
.select2-container .select2-choice { height: calc(1.5em + .75rem + 2px); line-height: calc(1.5em + .75rem); padding-left: .75rem; }
.select2-container .select2-choice .select2-arrow { background: transparent !important; border-left: 0 !important; }
.select2-container .select2-choice .select2-arrow b { background-position: 0 4px; }
.select2-drop { background: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color) !important; }
.select2-results .select2-highlighted { background: var(--l5-accent); color: #fff; }
.select2-search input { background-color: var(--bs-body-bg) !important; color: var(--bs-body-color); }
.select2-container-active .select2-choice, .select2-dropdown-open .select2-choice { border-color: rgba(var(--l5-accent-rgb), .6) !important; }

/* bootstrap-datepicker */
.datepicker.dropdown-menu { display: block; padding: .5rem; border-radius: var(--l5-radius); }
.datepicker table tr td.active, .datepicker table tr td.active:hover, .datepicker table tr td span.active { background: var(--l5-accent) !important; color: #fff; text-shadow: none; }

/* bootstrap-toggle 2.2 */
.toggle.btn { min-width: 52px; }
.toggle-group .btn { border-radius: 0; }

/* Leaflet controls in dark mode keep their own light look */
[data-bs-theme="dark"] .leaflet-container { background: #1b2230; }

/* dark mode: legacy plugin and inline whites */
[data-bs-theme="dark"] .select2-container .select2-choice .select2-arrow b { filter: invert(1); }
[data-bs-theme="dark"] .datepicker table tr td.day:hover, [data-bs-theme="dark"] .datepicker table tr td span:hover { background: #263040; }
[data-bs-theme="dark"] .bootstrap-switch { background: #263040; border-color: #344054; }
[data-bs-theme="dark"] .swal2-popup { background: #161c24; color: #e4e7ec; }

/* message level "error" of django.contrib.messages */
.alert-error { --bs-alert-color: var(--bs-danger-text-emphasis); --bs-alert-bg: var(--bs-danger-bg-subtle); --bs-alert-border-color: var(--bs-danger-border-subtle); }

/* ------------------------------------------------------------------ sign-in and account pages (allauth) */

.l5-auth-wrap { display: flex; min-height: 100vh; }
.l5-auth-brand {
    flex: 0 0 44%;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: #fff;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .14), transparent 45%),
        linear-gradient(150deg, var(--l5-accent), var(--l5-sidebar-bg) 85%);
}
.l5-auth-brand h1 { font-size: 2rem; font-weight: 700; max-width: 26rem; margin-bottom: 1rem; }
.l5-auth-brand p { font-size: 1.05rem; opacity: .85; max-width: 26rem; }
.l5-auth-logo { height: 40px; align-self: flex-start; filter: brightness(0) invert(1); }
.l5-auth-foot { font-size: .8rem; opacity: .7; }
.l5-auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.l5-auth-form { width: 100%; max-width: 380px; }
.l5-auth-form h2 { font-size: 1.6rem; font-weight: 700; }
.l5-auth-logo-small { height: 34px; margin-bottom: 2rem; }

.l5-account .account-logo { text-align: center; margin: 3rem 0 0; }
.l5-account .account-logo img { height: 40px; width: auto; }
.l5-account .account-menu { max-width: 560px; margin: 1rem auto 0; text-align: center; font-size: .875rem; }
.l5-account .account-menu a { margin: 0 .5rem; }
.l5-account .account-box {
    max-width: 560px; margin: 1.5rem auto 3rem; padding: 2rem; background: var(--l5-card-bg);
    border: 1px solid var(--l5-card-border); border-radius: var(--l5-radius); box-shadow: var(--l5-card-shadow);
}
.l5-account .account-box input[type=text], .l5-account .account-box input[type=password], .l5-account .account-box input[type=email] {
    display: block; width: 100%; padding: .5rem .75rem; margin-bottom: .75rem; color: var(--bs-body-color);
    background: var(--bs-body-bg); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius);
}
/* allauth buttons are Bootstrap buttons (templates/allauth/elements), spaced by their group */
.l5-account .account-box img { display: block; margin: .75rem auto; max-width: 240px; height: auto; }
