/*
 * Bestech Engineering — application theme
 * ---------------------------------------------------------------
 * Loaded LAST in template/header.blade.php so it layers on top of
 * the Rocker admin template + Bootstrap without changing any markup
 * behaviour. Purely visual: no layout hooks used by JS are removed.
 */

:root {
    /* Bestech logo colours: navy #00466E (structure) + crimson #FD1A4D (actions / highlights) */
    --bt-ink: #062a44;
    --bt-ink-2: #00466e;
    --bt-primary: #e8174b;
    --bt-primary-600: #c8113f;
    --bt-primary-700: #a30d33;
    --bt-accent: #ff4f78;
    --bt-soft: #ffe9ee;
    --bt-soft-2: #fff6f8;
    --bt-border: #e3e9ef;
    --bt-text: #1f3245;
    --bt-muted: #6b7d8f;
    --bt-bg: #f3f6f9;
    --bt-radius: 14px;
    --bt-radius-sm: 10px;
    --bt-shadow: 0 1px 2px rgba(0, 38, 63, .05), 0 6px 20px rgba(0, 38, 63, .07);
    --bt-shadow-lg: 0 18px 50px rgba(0, 38, 63, .16);
    --bt-gradient: linear-gradient(135deg, #fd1a4d 0%, #c8113f 100%);
    --bt-sidebar: linear-gradient(180deg, #00243c 0%, #003352 55%, #00466e 100%);
    --bt-font: "Plus Jakarta Sans", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;

    /* Bootstrap 5.3 variable bridge */
    --bs-primary: #e8174b;
    --bs-primary-rgb: 232, 23, 75;
    --bs-link-color: #e8174b;
    --bs-link-color-rgb: 232, 23, 75;
    --bs-link-hover-color: #a30d33;
    --bs-link-hover-color-rgb: 163, 13, 51;
    --bs-body-font-family: var(--bt-font);
    --bs-border-color: var(--bt-border);
    --bs-focus-ring-color: rgba(232, 23, 75, .25);
}

/* ---------- Base ---------- */
html, body {
    font-family: var(--bt-font);
}

body {
    background: var(--bt-bg);
    color: var(--bt-text);
    font-size: 13.5px;
    letter-spacing: .1px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--bt-ink);
    font-weight: 700;
    letter-spacing: -.1px;
}

a { color: var(--bt-primary); }
a:hover { color: var(--bt-primary-700); }

::selection { background: rgba(216, 35, 74, .18); }

/* Thin branded scrollbars */
* { scrollbar-width: thin; scrollbar-color: #ced8e1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d5dee6; border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Pace loader */
.pace .pace-progress { background: var(--bt-primary) !important; }

/* ---------- Sidebar ---------- */
.sidebar-wrapper {
    width: 260px;
    background: var(--bt-sidebar);
    border-right: 0;
    box-shadow: 4px 0 24px rgba(9, 36, 56, .18) !important;
}

.sidebar-wrapper .simplebar-content { min-height: 100%; }

.sidebar-header {
    width: 260px;
    height: 72px;
    padding: 0 18px;
    gap: 10px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(6px);
}

.sidebar-header .bt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.sidebar-header .logo-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: none;
    filter: drop-shadow(0 4px 10px rgba(251, 111, 141, .35));
}

.sidebar-header .logo-text {
    height: 42px;
    width: auto;
    margin-left: 0;
    display: block;
}

.sidebar-header .toggle-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #cddae7;
    background: rgba(255, 255, 255, .06);
    transition: background .2s, color .2s, transform .25s;
}

.sidebar-header .toggle-icon:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.wrapper.toggled .sidebar-header .toggle-icon { transform: rotate(180deg); }

.sidebar-wrapper .metismenu {
    margin-top: 72px;
    padding: 14px 12px;
}

.sidebar-wrapper .bt-menu-label {
    padding: 8px 14px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(205, 218, 231, .55);
}

.sidebar-wrapper .metismenu li + li { margin-top: 3px; }

.sidebar-wrapper .metismenu a {
    color: #dae2eb;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    letter-spacing: .1px;
    transition: background .2s, color .2s;
}

.sidebar-wrapper .metismenu a .parent-icon {
    font-size: 20px;
    width: 22px;
    text-align: center;
    color: #f69aae;
    transition: color .2s;
}

.sidebar-wrapper .metismenu a .menu-title { margin-left: 12px; }

.sidebar-wrapper .metismenu > li > a:hover,
.sidebar-wrapper .metismenu > li > a:focus {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.sidebar-wrapper .metismenu > li > a:hover .parent-icon { color: #fff; }

.sidebar-wrapper .metismenu > li.mm-active > a {
    color: #fff;
    background: var(--bt-gradient);
    box-shadow: 0 8px 20px rgba(216, 35, 74, .45);
}

.sidebar-wrapper .metismenu > li.mm-active > a .parent-icon { color: #fff; }

.sidebar-wrapper .metismenu ul {
    background: transparent;
    margin: 4px 0 6px 25px;
    padding-left: 12px;
    border-left: 1px solid rgba(205, 218, 231, .16);
}

.sidebar-wrapper .metismenu ul a {
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 400;
    color: #e4afba;
    border-radius: 8px;
}

.sidebar-wrapper .metismenu ul a i {
    margin-right: 8px;
    font-size: 14px;
    opacity: .55;
}

.sidebar-wrapper .metismenu ul a:hover,
.sidebar-wrapper .metismenu ul a:focus {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.sidebar-wrapper .metismenu ul .mm-active > a,
.sidebar-wrapper .metismenu ul a:active {
    color: #fff;
    background: rgba(251, 111, 141, .18);
    font-weight: 600;
}

.sidebar-wrapper .metismenu ul .mm-active > a i { opacity: 1; color: #cbd9e6; }

.sidebar-wrapper .metismenu .has-arrow:after {
    border-color: rgba(218, 226, 235, .7);
    right: 16px;
}

.sidebar-wrapper hr { border-color: rgba(255, 255, 255, .1); opacity: 1; margin: 6px 16px; }

/* Client logo card at the bottom of the sidebar */
.sidebar-wrapper .client-logo {
    margin: 10px 16px 24px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-wrapper .client-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px !important;
    padding: 4px;
    flex-shrink: 0;
}

.sidebar-wrapper .client-logo .bt-client-meta { min-width: 0; }
.sidebar-wrapper .client-logo .bt-client-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(205, 218, 231, .6);
    font-weight: 700;
}
.sidebar-wrapper .client-logo .bt-client-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Layout offsets for the wider sidebar */
.topbar { left: 260px; }
.page-wrapper { margin-left: 260px; margin-top: 68px; margin-bottom: 44px; }
.page-footer { left: 260px; }

/* Collapsed (desktop) */
@media screen and (min-width: 1025px) {
    .wrapper.toggled .topbar,
    .wrapper.toggled .page-footer { left: 76px; }
    .wrapper.toggled .page-wrapper { margin-left: 76px; }

    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper,
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-header { width: 76px; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-header { padding: 0; justify-content: center; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-header .bt-brand { flex: 0; justify-content: center; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-header .logo-icon { display: block; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .bt-menu-label,
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .client-logo .bt-client-meta { display: none; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .client-logo { margin: 10px 8px; padding: 6px; justify-content: center; }
    .wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .client-logo img { width: 40px; height: 40px; }
}

/* ---------- Topbar ---------- */
.topbar {
    height: 68px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--bt-border);
    box-shadow: none;
}

.topbar .navbar { height: 68px; padding-left: 1.5rem; padding-right: 1rem; }

.mobile-toggle-menu {
    color: var(--bt-ink);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bt-soft);
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

@media screen and (max-width: 1024px) {
    .mobile-toggle-menu { display: inline-flex !important; }
    .sidebar-wrapper { left: -300px; }
}

.bt-topbar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.bt-topbar-title .bt-hello { font-size: 12px; color: var(--bt-muted); font-weight: 500; }
.bt-topbar-title .bt-app { font-size: 16px; font-weight: 700; color: var(--bt-ink); white-space: nowrap; }
.bt-topbar-title .bt-app span { color: var(--bt-primary); }

.bt-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--bt-soft-2);
    border: 1px solid var(--bt-border);
    color: var(--bt-text);
    font-weight: 500;
    font-size: 12.5px;
    white-space: nowrap;
}
.bt-date-chip i { color: var(--bt-primary); font-size: 16px; }

.user-box {
    height: 68px;
    border: 0;
    padding-left: .75rem !important;
    padding-right: .25rem !important;
}

.user-box > a {
    padding: 5px 12px 5px 5px !important;
    border-radius: 40px;
    border: 1px solid var(--bt-border);
    background: #fff;
    transition: box-shadow .2s, border-color .2s;
}
.user-box > a:hover { border-color: #d6e0eb; box-shadow: var(--bt-shadow); }

.user-img {
    width: 36px;
    height: 36px;
    padding: 2px;
    background: var(--bt-gradient);
    border-radius: 50%;
    object-fit: cover;
}

.user-info .user-name { color: var(--bt-muted); font-size: 11px; font-weight: 500; }
.user-info .designattion {
    color: var(--bt-ink);
    font-size: 13px;
    font-weight: 700;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-box .bx-chevron-down { color: var(--bt-muted); font-size: 18px; }

@media screen and (max-width: 520px) {
    .user-box .user-info, .user-box .bx-chevron-down { display: none !important; }
    .user-box > a { padding: 3px !important; }
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    box-shadow: var(--bt-shadow-lg);
    padding: 6px;
}
.topbar .navbar .dropdown-menu::after { display: none; }
.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--bt-text);
    gap: 10px;
}
.dropdown-item i { color: var(--bt-primary); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bt-soft); color: var(--bt-primary-700); }
.dropdown-item.active, .dropdown-item:active { background: var(--bt-primary); color: #fff; }
.dropdown-item.active i, .dropdown-item:active i { color: #fff; }
.user-box .dropdown-menu .bt-dd-head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--bt-border);
    margin-bottom: 6px;
}
.user-box .dropdown-menu .bt-dd-head small { color: var(--bt-muted); display: block; }
.user-box .dropdown-menu .bt-dd-head strong { color: var(--bt-ink); }
.user-box .dropdown-menu .bt-logout, .user-box .dropdown-menu .bt-logout i { color: #d63a5a; }
.user-box .dropdown-menu .bt-logout:hover { background: #fdecef; color: #b3223f; }

/* ---------- Page content ---------- */
.page-content { padding: 1.75rem 1.75rem 1rem; }

.page-breadcrumb {
    background: #fff;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 12px 16px;
    box-shadow: var(--bt-shadow);
    margin-bottom: 1.25rem !important;
    min-height: 62px;
}

.breadcrumb-title { border-right: 0; font-size: 18px; font-weight: 700; color: var(--bt-ink); }
.page-breadcrumb .breadcrumb { align-items: center; }
.page-breadcrumb .breadcrumb li.breadcrumb-item {
    font-size: 13px;
    color: var(--bt-muted);
    font-weight: 600;
    letter-spacing: .6px;
}
.page-breadcrumb .breadcrumb li.breadcrumb-item a {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 16px;
}
.page-breadcrumb .breadcrumb li.breadcrumb-item.active { color: var(--bt-ink); font-weight: 700; }
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #ddabb6;
    font-family: var(--bt-font) !important;
    content: "\203A";
    font-size: 18px;
    line-height: 1;
    vertical-align: -1px;
    padding-right: .4rem;
}

/* Cards */
.card {
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    margin-bottom: 1.5rem;
    background: #fff;
}
.card .card { box-shadow: none; }
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--bt-border);
    padding: 14px 18px;
    font-weight: 700;
    color: var(--bt-ink);
}
.card-header:first-child { border-radius: var(--bt-radius) var(--bt-radius) 0 0; }
.card-body { padding: 1.25rem 1.35rem; }
.radius-10 { border-radius: var(--bt-radius) !important; }

/* Forms */
.form-label, .labletext {
    font-weight: 600;
    font-size: 12.5px;
    color: #425262;
    margin-bottom: 6px;
}

/* Underline-style fields: bottom line only */
.form-control, .form-select {
    border: 0;
    border-bottom: 1px solid #cfd6dd;
    border-radius: 0;
    padding: .45rem .2rem;
    font-size: 13.5px;
    color: var(--bt-text);
    background-color: transparent;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-select { padding-right: 2rem; background-position: right .2rem center; }
.form-control::placeholder { color: #a1b0be; }
.form-control:focus, .form-select:focus {
    border-color: var(--bt-accent);
    box-shadow: 0 1px 0 0 var(--bt-accent); /* thicker line on focus, no layout shift */
    background-color: transparent;
}
.form-control:disabled, .form-control[readonly],
.form-select:disabled {
    background-color: transparent;
    border-bottom-style: dashed;
    color: var(--bt-muted);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: #dc3545; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 1px 0 0 #dc3545; }
/* multi-line text keeps a light box so the writing area is visible */
textarea.form-control {
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: .5rem .7rem;
}
textarea.form-control:focus { box-shadow: 0 0 0 3px rgba(216, 35, 74, .12); }
.form-control-sm, .form-select-sm { border-radius: 0; }
/* Search boxes keep the full rectangle */
input.form-control[type="search"],
input.form-control[name="search"],
input.form-control[placeholder^="Search" i] {
    border: 1px solid #dde2e8;
    border-radius: 10px;
    padding: .45rem .75rem;
    background-color: #fff;
}
input.form-control[type="search"]:focus,
input.form-control[name="search"]:focus,
input.form-control[placeholder^="Search" i]:focus {
    border-color: var(--bt-accent);
    box-shadow: 0 0 0 3px rgba(216, 35, 74, .12);
}
.input-group-text {
    border: 0;
    border-bottom: 1px solid #cfd6dd;
    border-radius: 0;
    background: transparent;
    color: var(--bt-muted);
}
.form-check-input { border-color: #e5bbc4; }
.form-check-input:checked { background-color: var(--bt-primary); border-color: var(--bt-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(216, 35, 74, .15); border-color: var(--bt-accent); }
.form-switch .form-check-input:focus { --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='%239b6bff'/%3e%3c/svg%3e"); }

/* Buttons */
.btn {
    font-size: 12px;
    white-space: nowrap;
    padding: .5rem 1rem;
    letter-spacing: .2px;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; padding: .3rem .7rem; font-size: 12px; }
.btn-lg { border-radius: 12px; }

.btn-primary,
.btn-secondary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--bt-primary);
    --bs-btn-border-color: var(--bt-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bt-primary-600);
    --bs-btn-hover-border-color: var(--bt-primary-600);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--bt-primary-700);
    --bs-btn-active-border-color: var(--bt-primary-700);
    --bs-btn-disabled-bg: #dc8699;
    --bs-btn-disabled-border-color: #dc8699;
    --bs-btn-focus-shadow-rgb: 107, 43, 208;
    color: #fff;
    background: var(--bt-gradient);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(216, 35, 74, .28);
}
.btn-primary:hover, .btn-secondary:hover,
.btn-primary:focus, .btn-secondary:focus {
    color: #fff;
    background: linear-gradient(135deg, #d8234a 0%, #9c1331 100%);
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(216, 35, 74, .38);
}
.btn-primary:disabled, .btn-secondary:disabled { background: #dc8699; box-shadow: none; }

.btn-outline-secondary,
.btn-outline-primary {
    --bs-btn-color: var(--bt-primary);
    --bs-btn-border-color: #cbd8e4;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bt-primary);
    --bs-btn-hover-border-color: var(--bt-primary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--bt-primary-700);
    --bs-btn-active-border-color: var(--bt-primary-700);
    color: var(--bt-primary);
    border-color: #cbd8e4;
    background: #fff;
}
.btn-outline-secondary:hover, .btn-outline-primary:hover { color: #fff; background: var(--bt-primary); border-color: var(--bt-primary); }

.btn-light { background: var(--bt-soft); border-color: var(--bt-soft); color: var(--bt-primary-700); }
.btn-light:hover { background: #e6ecf3; border-color: #e6ecf3; color: var(--bt-primary-700); }

.btn-success { box-shadow: 0 6px 16px rgba(25, 135, 84, .2); }
.btn-danger { box-shadow: 0 6px 16px rgba(220, 53, 69, .2); }

.btn-close:focus { box-shadow: 0 0 0 4px rgba(216, 35, 74, .15); }

/* Tables */
.table { --bs-table-hover-bg: #fafbfd; color: var(--bt-text); margin-bottom: .5rem; }
.table > :not(caption) > * > * { padding: .75rem .85rem; border-bottom-color: #f0f2f5; }
.table thead th,
.table .table-light th,
.table-light,
.table > thead.table-light > tr > th {
    --bs-table-bg: #f7f9fb;
    background-color: #f7f9fb !important;
    color: #3f5b78;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid #e4eaf0 !important;
    white-space: nowrap;
}
.table thead th:first-child { border-top-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover > * { background-color: #fafbfd; }
.table-responsive { border-radius: 12px; }
.table-bordered > :not(caption) > * > * { border-color: #ecf0f3; }

/* Row action icons */
.order-actions a {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 16px;
    background: var(--bt-soft);
    border: 1px solid #e6ecf3;
    color: var(--bt-primary);
    transition: all .2s;
}
.order-actions a:hover { background: var(--bt-primary); border-color: var(--bt-primary); color: #fff; }

/* DataTables */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px;
    border: 1px solid #dde2e8;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--bt-accent); box-shadow: 0 0 0 4px rgba(216, 35, 74, .12); outline: 0; }
.dataTables_wrapper .dataTables_info { color: var(--bt-muted); font-size: 12.5px; }

/* Pagination */
.pagination { gap: 4px; }
.page-link {
    border-radius: 9px !important;
    border: 1px solid var(--bt-border);
    color: var(--bt-primary);
    min-width: 34px;
    text-align: center;
    font-weight: 600;
}
.page-link:hover { background: var(--bt-soft); color: var(--bt-primary-700); border-color: #d6e0eb; }
.page-link:focus { box-shadow: 0 0 0 4px rgba(216, 35, 74, .15); }
.page-item.active .page-link,
.active > .page-link {
    background: var(--bt-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px rgba(216, 35, 74, .3);
}
.page-item.disabled .page-link { color: #aebbc8; background: #fff; }

/* Modals */
.modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(9, 36, 56, .3);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(135deg, #fafbfd 0%, #f1f5f8 100%);
    border-bottom: 1px solid var(--bt-border);
    padding: 16px 22px;
    position: relative;
}
.modal-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    background: var(--bt-gradient);
}
.modal-title { font-weight: 700; color: var(--bt-ink); font-size: 16px; }
.modal-body { padding: 20px 22px; }
.modal-body > .row > [class*="col"] > .card,
.modal-body .card { border: 0; box-shadow: none; margin-bottom: 0; }
.modal-footer { border-top: 1px solid var(--bt-border); background: #fafbfd; padding: 12px 22px; }
.modal-backdrop.show { opacity: .45; background: #092438; }

/* Tabs / nav pills */
.nav-tabs { border-bottom: 1px solid var(--bt-border); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--bt-muted); font-weight: 600; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--bt-primary); }
.nav-tabs .nav-link.active { color: var(--bt-primary); border-bottom-color: var(--bt-primary); background: transparent; }
.nav-pills .nav-link { border-radius: 10px; color: var(--bt-muted); font-weight: 600; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--bt-gradient); color: #fff; }

/* Badges & alerts */
.badge { font-weight: 600; letter-spacing: .3px; border-radius: 7px; padding: .38em .65em; }
.bg-primary { background-color: var(--bt-primary) !important; }
.text-primary { color: var(--bt-primary) !important; }
.border-primary { border-color: var(--bt-primary) !important; }
.alert { border-radius: 12px; border-width: 1px; }
.alert-danger { background: #fff1f3; border-color: #fbd2da; color: #9d1c36; }
.alert-success { background: #eefaf3; border-color: #c7ecd6; color: #146c43; }

/* List groups */
.list-group-item.active { background: var(--bt-primary); border-color: var(--bt-primary); }
.list-group-item-action:hover { background: var(--bt-soft-2); }

/* Select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap4 .select2-selection {
    border: 0 !important;
    border-bottom: 1px solid #cfd6dd !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    min-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-left: 3px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection { border-color: var(--bt-accent) !important; box-shadow: 0 1px 0 0 var(--bt-accent) !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--bt-primary); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--bt-soft); border-color: #dbe4ee; color: var(--bt-primary-700); border-radius: 7px; }
.select2-dropdown { border-color: var(--bt-border); border-radius: 10px; overflow: hidden; box-shadow: var(--bt-shadow-lg); }

/* Flatpickr */
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.startRange, .flatpickr-day.endRange {
    background: var(--bt-primary);
    border-color: var(--bt-primary);
}
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { color: var(--bt-ink); }

/* Lobibox notifications */
.lobibox-notify { border-radius: 12px !important; box-shadow: var(--bt-shadow-lg) !important; }

/* Footer */
.page-footer {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--bt-border);
    color: var(--bt-muted);
    font-size: 12.5px;
    padding: 9px 1.5rem;
}
.page-footer .bt-footer-inner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.page-footer img { height: 18px; width: auto; }
.page-footer strong { color: var(--bt-ink); }

/* Back to top */
.back-to-top {
    background: var(--bt-gradient);
    border-radius: 12px;
    bottom: 56px;
    right: 18px;
    box-shadow: 0 10px 24px rgba(216, 35, 74, .35);
}
.back-to-top:hover { background: var(--bt-ink); }

/* ---------- Dashboard ---------- */
.bt-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 26px 30px;
    margin-bottom: 1.5rem;
    color: #fff;
    background:
        radial-gradient(900px 300px at 100% -20%, rgba(251, 111, 141, .55), transparent 60%),
        radial-gradient(500px 240px at 0% 120%, rgba(216, 35, 74, .6), transparent 60%),
        linear-gradient(135deg, #092438 0%, #0e466e 100%);
    box-shadow: 0 18px 40px rgba(9, 36, 56, .22);
}
.bt-hero::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -40px;
    width: 230px;
    height: 230px;
    background: url("../images/bestech-icon.png") no-repeat center / contain;
    opacity: .16;
    transform: rotate(-8deg);
    pointer-events: none;
}
.bt-hero h2 { color: #fff; font-size: 24px; font-weight: 800; margin: 4px 0 6px; }
.bt-hero p { color: #dae2eb; margin: 0; font-size: 13.5px; max-width: 560px; }
.bt-hero .bt-eyebrow { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: #cbd9e6; font-weight: 700; }
.bt-hero .bt-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    position: relative;
    z-index: 1;
}
.bt-hero .bt-hero-pill .dot-live { width: 8px; height: 8px; border-radius: 50%; background: #3ee08f; box-shadow: 0 0 0 4px rgba(62, 224, 143, .2); }

.bt-stat {
    position: relative;
    overflow: hidden;
    height: calc(100% - 1.5rem);
    transition: transform .2s ease, box-shadow .2s ease;
}
.bt-stat:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(9, 36, 56, .12); }
.bt-stat .card-body { padding: 20px 20px 18px; }
.bt-stat .bt-stat-label { font-size: 12.5px; font-weight: 600; color: var(--bt-muted); margin: 0; }
.bt-stat .bt-stat-value { font-size: 30px; font-weight: 800; color: var(--bt-ink); margin: 6px 0 0; line-height: 1.1; }
.bt-stat .bt-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}
.bt-stat .bt-stat-bar { height: 4px; border-radius: 4px; background: #f1f3f6; margin-top: 16px; overflow: hidden; }
.bt-stat .bt-stat-bar span { display: block; height: 100%; border-radius: 4px; }
.bt-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

.bt-stat.is-violet::before, .bt-stat.is-violet .bt-stat-icon, .bt-stat.is-violet .bt-stat-bar span { background: linear-gradient(135deg, #fb577b, #bc193c); }
.bt-stat.is-teal::before, .bt-stat.is-teal .bt-stat-icon, .bt-stat.is-teal .bt-stat-bar span { background: linear-gradient(135deg, #22c3a6, #0f8f7a); }
.bt-stat.is-amber::before, .bt-stat.is-amber .bt-stat-icon, .bt-stat.is-amber .bt-stat-bar span { background: linear-gradient(135deg, #ffb547, #f07b12); }
.bt-stat.is-rose::before, .bt-stat.is-rose .bt-stat-icon, .bt-stat.is-rose .bt-stat-bar span { background: linear-gradient(135deg, #ff6b8b, #d6335a); }
.bt-stat.is-violet .bt-stat-icon { box-shadow: 0 8px 18px rgba(216, 35, 74, .3); }
.bt-stat.is-teal .bt-stat-icon { box-shadow: 0 8px 18px rgba(15, 143, 122, .28); }
.bt-stat.is-amber .bt-stat-icon { box-shadow: 0 8px 18px rgba(240, 123, 18, .28); }
.bt-stat.is-rose .bt-stat-icon { box-shadow: 0 8px 18px rgba(214, 51, 90, .28); }

.bt-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.bt-card-title h6 { margin: 0; font-size: 15px; font-weight: 700; }
.bt-card-title small { color: var(--bt-muted); }
.bt-card-title .bt-icon-badge {
    width: 36px; height: 36px; border-radius: 10px; background: var(--bt-soft); color: var(--bt-primary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 10px;
}

.gmaps#marker-map, #marker-map { height: 460px; border-radius: 12px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media screen and (max-width: 1024px) {
    .topbar, .page-footer { left: 0 !important; }
    .page-wrapper { margin-left: 0 !important; }
    .wrapper.toggled .overlay { background: #092438; opacity: .55; }
    .sidebar-header .toggle-icon { display: inline-flex; }
}

@media screen and (max-width: 767px) {
    .page-content { padding: 1rem .9rem .75rem; }
    .bt-hero { padding: 20px; }
    .bt-hero h2 { font-size: 20px; }
    .bt-date-chip { display: none !important; }
    .topbar .navbar { padding-left: .9rem; padding-right: .5rem; }
}

@media print {
    .sidebar-wrapper, .topbar, .page-footer, .back-to-top { display: none !important; }
    .page-wrapper { margin: 0 !important; }
}

/* ---------- Master Console ---------- */
.bt-stat .bt-stat-of { font-size: 16px; font-weight: 600; color: var(--bt-muted); }

.bt-switch-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 52px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: var(--bt-soft-2);
}
.bt-switch-row .form-check-input { margin-top: 3px; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }

.bt-module {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--bt-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s, opacity .2s;
    opacity: .72;
}
.bt-module:hover { border-color: #d6e0eb; box-shadow: var(--bt-shadow); opacity: 1; }
.bt-module.is-on { opacity: 1; border-color: #d6e0eb; background: linear-gradient(135deg, #fff 0%, #fafbfd 100%); }
.bt-module.is-core { cursor: default; }
.bt-module-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 21px;
    background: #f1f3f6; color: #90a1b3; transition: background .2s, color .2s;
}
.bt-module.is-on .bt-module-icon { background: var(--bt-gradient); color: #fff; box-shadow: 0 6px 14px rgba(216, 35, 74, .25); }
.bt-module-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.bt-module-name { font-weight: 700; color: var(--bt-ink); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-module-desc { color: var(--bt-muted); font-size: 12.5px; line-height: 1.45; }
.bt-module-meta { color: #9faebd; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; margin-top: 2px; }
.bt-badge-core { background: var(--bt-soft) !important; color: var(--bt-primary-700) !important; font-size: 10.5px; }
.bt-module .form-check-input:disabled { opacity: .8; }

.bt-site-usage {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    border-radius: 10px; background: var(--bt-soft-2); border: 1px solid var(--bt-border);
    font-weight: 600; font-size: 12.5px; color: var(--bt-text); white-space: nowrap;
}
.bt-site-usage i { color: var(--bt-primary); font-size: 16px; }
.bt-site-usage.is-full { background: #fff1f3; border-color: #fbd2da; color: #9d1c36; }
.bt-site-usage.is-full i { color: #d6335a; }

.sidebar-wrapper .metismenu > li.bt-master-link > a { border: 1px dashed rgba(203, 217, 230, .35); }
.sidebar-wrapper .metismenu > li.bt-master-link > a .parent-icon { color: #ffcf5c; }

/* ---------- Security Agencies (Master Console) ---------- */
.bt-agency-table td { vertical-align: middle; }
.bt-agency-table tr.bt-row-selected > td { background: #f8fafc !important; }
.bt-agency-logo {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bt-soft); color: var(--bt-primary); font-size: 20px; border: 1px solid var(--bt-border);
}
.bt-agency-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; }
.bt-badge-active { background: #e7f8ef !important; color: #127a4a !important; }
.bt-badge-suspended { background: #fdecef !important; color: #b3223f !important; }
.bt-form-section {
    font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--bt-primary-700); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--bt-border);
}
.bt-form-section:first-child { margin-top: 0; }
.bt-section-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 6px 0 16px; padding: 14px 18px; border-radius: var(--bt-radius);
    background: linear-gradient(135deg, #fff 0%, #f7f9fb 100%); border: 1px solid #e2e9f1;
}
.bt-eyebrow-dark { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--bt-muted); font-weight: 700; }
.bt-empty-icon {
    width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: var(--bt-soft); color: var(--bt-primary); font-size: 26px;
}

/* Agency switcher (top bar, master only) */
.bt-agency-switch .dropdown-toggle { max-width: 260px; }
.bt-agency-switch .dropdown-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-agency-switch .dropdown-menu { min-width: 280px; max-height: 60vh; overflow-y: auto; }
.bt-agency-switch .dropdown-item.is-current { background: var(--bt-soft); font-weight: 700; }
.bt-agency-switch .dropdown-item small { color: var(--bt-muted); }

/* A <form> wrapping header/body/footer inside a scrollable modal must pass the
   flex layout through, otherwise the body cannot scroll and the footer
   (submit button) is cut off. */
.modal-content > form.bt-modal-form,
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }

/* Right-side slide-in panel built on a Bootstrap modal.
   Add "bt-modal-right" to the .modal element; JS/data-bs-* usage is unchanged. */
.modal.bt-modal-right .modal-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    width: 960px;
    max-width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform .3s ease-out;
}
.modal.bt-modal-right.show .modal-dialog { transform: none; }
.modal.bt-modal-right .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(0, 0, 0, .18);
}
.modal.bt-modal-right .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    border-radius: 0;
}
.modal.bt-modal-right .modal-dialog.modal-lg { width: 800px; }
.modal.bt-modal-right .modal-dialog.modal-md,
.modal.bt-modal-right .modal-dialog:not(.modal-lg):not(.modal-xl) { width: 520px; }
.modal.bt-modal-right .modal-dialog.modal-xl { width: 960px; }
/* scrollable variant (form wraps header/body/footer): body scrolls, footer stays visible */
.modal.bt-modal-right .modal-dialog-scrollable .modal-content { overflow: hidden; max-height: none; }
.modal.bt-modal-right .modal-dialog-scrollable { max-height: none; }

/* Pre-Employment: Add New Employee form */
.bt-pe-form { padding: 4px 2px; }
.bt-pe-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--bt-primary);
    padding-bottom: 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--bt-border);
}
.bt-pe-list { border: 1px solid var(--bt-border); border-radius: 12px; overflow: hidden; }
.bt-pe-item { padding: 12px 16px; background: #fff; }
.bt-pe-item + .bt-pe-item { border-top: 1px solid var(--bt-border); }
.bt-pe-item:nth-child(even) { background: #fafbfd; }
.bt-pe-row { display: flex; align-items: center; gap: 12px; }
.bt-pe-num {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bt-pe-question { flex: 1 1 auto; font-size: 13.5px; color: var(--bt-text); }
.bt-pe-choice { flex: 0 0 auto; }
.bt-pe-choice .btn { min-width: 56px; }
.bt-pe-remarks { padding: 10px 0 2px 38px; }
.bt-pe-remarks textarea.form-control { resize: vertical; min-height: 60px; background: #fff; }
@media (max-width: 575.98px) {
    .bt-pe-row { flex-wrap: wrap; }
    .bt-pe-choice { margin-left: 38px; }
}

/* List page toolbar: search + actions on the left, page size + pagination on the right */
.bt-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bt-border);
}
.bt-list-toolbar-bottom { border-bottom: 0; padding: 16px 0 0; margin: 0; }
.bt-list-toolbar-left,
.bt-list-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bt-list-search { width: 320px; max-width: 100%; flex-wrap: nowrap; }
.bt-list-search .form-control { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.bt-list-search .btn { padding-left: 14px; padding-right: 14px; }
.bt-list-toolbar-right label { font-size: 13px; color: var(--bt-muted); white-space: nowrap; }
.bt-list-toolbar select.bt-per-page {
    width: auto;
    min-width: 72px;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: .3rem 2rem .3rem .6rem;
    background-color: #fff;
}
.bt-list-toolbar .pagination { margin: 0; }
.bt-list-toolbar nav p { margin: 0; }

/* Row actions dropdown (first column of list tables) */
.bt-row-actions { width: 1%; white-space: nowrap; text-align: center; }
.bt-action-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid #e7edf3;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 18px;
    line-height: 1;
}
.bt-action-toggle:hover,
.bt-action-toggle[aria-expanded="true"] { background: var(--bt-primary); border-color: var(--bt-primary); color: #fff; }
.bt-action-menu { min-width: 190px; padding: 6px; border-radius: 10px; border: 1px solid var(--bt-border); box-shadow: var(--bt-shadow-lg); }
.bt-action-menu .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.bt-action-menu .dropdown-item i { font-size: 16px; color: var(--bt-primary); }
.bt-action-menu .dropdown-item.text-danger i { color: inherit; }
.bt-action-menu .dropdown-item:hover { background: var(--bt-soft); }
.bt-action-menu .dropdown-item.text-danger:hover { background: #fff1f3; color: #b4233f !important; }
.bt-action-menu .dropdown-divider { margin: 4px 0; }

/* ---------- Select2 dropdowns (all form selects) ---------- */
.select2-container { font-size: 13.5px; }
.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 38px;
    display: flex;
    align-items: center;
    transition: border-color .15s, box-shadow .15s;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--bt-text);
    line-height: 1.4;
    padding: .45rem 1.8rem .45rem .2rem;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #a1b0be; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; top: 0; right: 2px; width: 22px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: 0;
    width: 8px;
    height: 8px;
    margin: -6px 0 0 -4px;
    border-right: 2px solid #6f8499;
    border-bottom: 2px solid #6f8499;
    transform: rotate(45deg);
    transition: transform .15s;
}
.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(-135deg);
    margin-top: -1px;
    border-color: var(--bt-accent) !important;
}
.select2-container--default.select2-container--disabled .select2-selection--single {
    border-bottom-style: dashed !important;
    background: transparent !important;
}
.select2-container--default.select2-container--disabled .select2-selection__rendered { color: var(--bt-muted); }
.is-invalid + .select2-container .select2-selection { border-bottom-color: #dc3545 !important; }

/* dropdown panel */
.select2-dropdown {
    border: 1px solid var(--bt-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(9, 36, 56, .16);
    overflow: hidden;
    margin-top: 4px;
    z-index: 2000;
}
.select2-container--open .select2-dropdown--above { margin-top: 0; margin-bottom: 4px; }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #dde2e8;
    border-radius: 8px;
    padding: 6px 10px;
    outline: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--bt-accent);
    box-shadow: 0 0 0 3px rgba(216, 35, 74, .12);
}
.select2-container--default .select2-results > .select2-results__options { max-height: 260px; padding: 4px; }
.select2-container--default .select2-results__option {
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--bt-text);
    margin: 1px 0;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--bt-soft) !important;
    color: var(--bt-primary-700) !important;
}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected {
    background: var(--bt-primary) !important;
    color: #fff !important;
    font-weight: 600;
}
.select2-container--default .select2-results__option[aria-disabled="true"] { color: #aebbc8; }
.select2-results__message { color: var(--bt-muted); font-size: 12.5px; }
/* inside the slide-in panels the dropdown must sit above the modal */
.modal .select2-dropdown { z-index: 2100; }

/* Edit panels live inside the (centred, no-wrap) action cell -> reset what they inherit */
.bt-row-actions .modal,
.bt-row-actions .dropdown-menu { text-align: left; white-space: normal; }

/* ---------- Form panels (slide-in add/edit forms) ---------- */
.modal.bt-modal-right .modal-body { padding: 22px 26px 0; background: #fff; }
.modal.bt-modal-right .modal-body > .row > [class*="col"] > .card,
.modal.bt-modal-right .modal-body .card { padding: 0; margin: 0; }
.modal.bt-modal-right .modal-body .card-body { padding: 0; }
.modal.bt-modal-right .modal-body form.row { margin: 0; }
.modal.bt-modal-right .modal-body form.row > * { padding: 0; }
/* field rows: even vertical rhythm */
.modal.bt-modal-right .modal-body .row.mb-3 { margin-bottom: 0 !important; row-gap: 0; }
.modal.bt-modal-right .modal-body .row.mb-3 > [class*="col"] { margin-bottom: 20px; }
/* labels: left aligned, small caps-style */
.modal.bt-modal-right .form-label,
.modal.bt-modal-right .labletext {
    display: block;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #637485;
    margin-bottom: 4px;
}
.modal.bt-modal-right .form-label .bt-req { color: #dc3545; margin-left: 2px; }
/* label + <br> + radios: keep the label tight */
.modal.bt-modal-right .form-label + br { display: none; }
.modal.bt-modal-right input[type="radio"]:not(.btn-check),
.modal.bt-modal-right input[type="checkbox"]:not(.btn-check) {
    width: 16px;
    height: 16px;
    margin: 10px 6px 0 18px;
    vertical-align: -3px;
    accent-color: var(--bt-primary);
    float: none;
}
.modal.bt-modal-right .form-label + br + input[type="radio"],
.modal.bt-modal-right .form-label + input[type="radio"],
.modal.bt-modal-right .form-label + br + input[type="checkbox"] { margin-left: 0; }
/* file inputs */
.modal.bt-modal-right input[type="file"].form-control { padding: .35rem 0; font-size: 13px; color: var(--bt-muted); }
.modal.bt-modal-right input[type="file"].form-control::file-selector-button {
    border: 1px solid #dde2e8;
    border-radius: 8px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-weight: 600;
    padding: .35rem .9rem;
    margin: 0 12px 0 0;
    cursor: pointer;
    transition: background .15s;
}
.modal.bt-modal-right input[type="file"].form-control:hover::file-selector-button { background: #e9eff4; }
/* Save bar pinned to the bottom of the panel */
.modal.bt-modal-right .modal-body .row:has(> [class*="col"] > button[type="submit"]),
.modal.bt-modal-right .modal-body .text-end:not([class*="col"]):has(> button[type="submit"]) {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 8px -26px 0 !important;
    padding: 14px 26px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--bt-border);
    backdrop-filter: blur(4px);
}
.modal.bt-modal-right .modal-body .row:has(> [class*="col"] > button[type="submit"]) > [class*="col"] { margin-bottom: 0; text-align: right; }
.modal.bt-modal-right button[type="submit"] { min-width: 140px; }
.form-label .bt-req, .labletext .bt-req { color: #dc3545; margin-left: 3px; }

/* ---------- Edit Occurrence panel ---------- */
.bt-occ-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    padding: 12px 14px;
    margin-bottom: 22px;
    border-radius: 10px;
    background: var(--bt-soft-2, #fafbfd);
    border: 1px solid var(--bt-border);
}
.bt-occ-meta > div { display: flex; flex-direction: column; gap: 2px; }
.bt-occ-meta-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8293a3; }
.bt-occ-meta-value { font-size: 13.5px; font-weight: 600; color: var(--bt-ink, #092438); display: inline-flex; align-items: center; gap: 6px; }
.bt-occ-meta-value i { color: var(--bt-primary); font-size: 16px; }
.bt-field { margin-bottom: 20px; }
/* input with a trailing icon (date pickers) */
.bt-input-icon { position: relative; }
.bt-input-icon > .form-control { padding-right: 28px; cursor: pointer; background-color: transparent; }
.bt-input-icon > i { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: #6f8499; font-size: 18px; pointer-events: none; }
.bt-input-icon > .form-control[readonly] { border-bottom-style: solid; color: var(--bt-text); }
.modal.bt-modal-right .bt-occ-form textarea.form-control { min-height: 120px; }
.modal.bt-modal-right .btn-light { background: #f4f6f8; border-color: #e7edf3; color: #425262; }
.modal.bt-modal-right .btn-light:hover { background: #eaeef3; }

/* ---------- View panels (read-only details in the slide-in panel) ---------- */
.modal.bt-modal-right .modal-body.row { margin: 0; }
.modal.bt-modal-right .list-group-flush {
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px;
}
.modal.bt-modal-right .list-group-flush > .list-group-item {
    padding: 12px 16px;
    gap: 4px 16px;
    border-color: var(--bt-border);
    background: #fff;
}
.modal.bt-modal-right .list-group-flush > .list-group-item:nth-child(even) { background: #fafbfd; }
.modal.bt-modal-right .list-group-item > p,
.modal.bt-modal-right .list-group-item > p b {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8293a3;
}
.modal.bt-modal-right .list-group-item > .text-secondary {
    color: var(--bt-ink, #092438) !important;
    font-weight: 600;
    font-size: 13.5px;
    text-align: right;
}
.modal.bt-modal-right .modal-body hr { display: none; }
/* long text blocks (details / what happened) */
.modal.bt-modal-right .modal-body [class*="col"] > p.mb-0 > b {
    display: block;
    font-size: 11.5px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8293a3;
    margin-bottom: 6px;
}
.modal.bt-modal-right .modal-body [class*="col"] > p.mb-0 + .text-secondary {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fafbfd;
    border: 1px solid var(--bt-border);
    color: var(--bt-text) !important;
    line-height: 1.55;
    white-space: pre-line !important;
}
.modal.bt-modal-right .modal-body img { max-width: 100%; height: auto; border-radius: 10px; }
/* incident view uses <h6> labels; "Yes" answers may carry a note underneath */
.modal.bt-modal-right .list-group-item > h6 {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8293a3;
    margin: 0;
}
.modal.bt-modal-right .list-group-item > .text-secondary + .text-secondary {
    flex-basis: 100%;
    text-align: right;
    font-weight: 400 !important;
    font-size: 12.5px;
    color: #637485 !important;
    font-style: italic;
}
.modal.bt-modal-right .list-group-item > img {
    width: auto !important;
    max-height: 56px;
    max-width: 160px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--bt-border);
    padding: 4px;
}
.modal.bt-modal-right .modal-body [class*="col"] > h6.mb-0 {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #8293a3;
    margin-bottom: 6px !important;
}
.modal.bt-modal-right .modal-body [class*="col"] > h6.mb-0 + .text-secondary {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fafbfd;
    border: 1px solid var(--bt-border);
    color: var(--bt-text) !important;
    line-height: 1.55;
    white-space: pre-line !important;
}

/* ---------- Filter card (list pages) ---------- */
.bt-filter-card .card-body { padding: 18px 22px 22px; }
.bt-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bt-border);
}
.bt-filter-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--bt-ink, #092438); font-size: 14px; }
.bt-filter-title i { color: var(--bt-primary); font-size: 18px; }
.bt-filter-actions { display: flex; gap: 8px; }
.bt-filter-search {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
}
.bt-filter-search i { font-size: 17px; }
.bt-filter-reset {
    flex: 0 0 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f4f6f8;
    border: 1px solid #e7edf3;
    color: #637485;
    font-size: 18px;
}
.bt-filter-reset:hover { background: #eaeef3; color: var(--bt-primary); }
.bt-filter-card .btn-outline-primary { border-radius: 10px; font-weight: 600; }
.bt-action-menu button.dropdown-item { width: 100%; text-align: left; border: 0; background: none; }
.bt-filter-search { min-width: 140px; }
.bt-filter-search { min-width: 140px; }

/* ---------- Multi-entry forms (Add Occurrence) ---------- */
.bt-entry-head .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
}
.bt-entry-head-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--bt-ink, #092438); }
.bt-entry-head-title i { color: var(--bt-primary); font-size: 20px; }
.bt-entry-head-sub { color: var(--bt-muted); font-size: 12.5px; margin-top: 2px; }
.bt-entry-head .btn-outline-primary { border-radius: 10px; font-weight: 600; }

.bt-entry .card { margin-bottom: 0; border: 1px solid var(--bt-border); }
.bt-entry .card-body { padding: 18px 22px 22px; }
.bt-entry-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--bt-ink, #092438);
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bt-border);
}
.bt-entry-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bt-gradient, var(--bt-primary));
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bt-entry-remove {
    margin-left: auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #fbd2da;
    background: #fff1f3;
    color: #b4233f;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bt-entry-remove:hover { background: #dc3545; border-color: #dc3545; color: #fff; }
.bt-entry .form-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #637485;
    margin-bottom: 4px;
}
.bt-entry .bt-req { color: #dc3545; }
.bt-entry textarea.form-control { min-height: 110px; }
/* flatpickr alt input sits right after the hidden real input */
.bt-input-icon input.is-invalid + .form-control { border-bottom-color: #dc3545; }

.bt-entry-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--bt-border);
    border-radius: 14px;
    box-shadow: 0 -6px 24px rgba(9, 36, 56, .06);
    backdrop-filter: blur(4px);
}
.bt-entry-count { color: var(--bt-muted); font-size: 13px; font-weight: 600; }
.bt-entry-footer .btn-light { background: #f4f6f8; border-color: #e7edf3; color: #425262; }

/* native date/time inputs: hide the browser's own icon but keep it clickable under ours */
.bt-input-icon > input[type="date"],
.bt-input-icon > input[type="time"],
.bt-input-icon > input[type="month"],
.bt-input-icon > input[type="datetime-local"] { position: relative; }
.bt-input-icon > input::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 28px;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.bt-input-icon > .form-control { padding-right: 28px; }

/* Add Occurrence: one line per entry */
.bt-lines { padding: 6px 0; overflow: visible; }
.bt-line {
    display: grid;
    grid-template-columns: 34px minmax(170px, 1.3fr) minmax(150px, 1fr) minmax(190px, 1.1fr) minmax(220px, 2fr) 34px;
    gap: 14px;
    align-items: start;
    padding: 12px 20px;
}
.bt-line-head {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #637485;
    border-bottom: 1px solid var(--bt-border);
}
.bt-line-head .bt-req { color: #dc3545; }
.bt-lines .bt-entry + .bt-entry { border-top: 1px dashed var(--bt-border); }
.bt-lines .bt-entry:hover { background: #fafbfd; }
.bt-line .bt-entry-num { margin-top: 7px; }
.bt-line .bt-entry-remove { margin: 4px 0 0; }
.bt-line textarea.bt-autogrow {
    min-height: 38px;
    height: 38px;
    resize: none;
    overflow: hidden;
    border-radius: 8px;
    padding: .45rem .7rem;
    line-height: 1.4;
}
@media (max-width: 991.98px) {
    .bt-line { grid-template-columns: 1fr; gap: 12px; padding: 16px 18px; }
    .bt-line .bt-entry-num { margin: 0; }
    .bt-line .bt-entry-remove { justify-self: end; }
    .bt-line textarea.bt-autogrow { height: 80px; overflow: auto; }
}
/* Select2: theme focus instead of the browser's black outline */
.select2-container .select2-selection:focus { outline: none; }
.select2-container--default.select2-container--focus .select2-selection--single {
    border-bottom-color: var(--bt-accent) !important;
    box-shadow: 0 1px 0 0 var(--bt-accent) !important;
}

/* Select2 multi-select (filter cards) */
.select2-container--default .select2-selection--multiple {
    min-height: 38px !important;
    padding: 3px 26px 3px 0;
    cursor: pointer;
    position: relative;
}
.select2-container--default .select2-selection--multiple::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid #6f8499;
    border-bottom: 2px solid #6f8499;
    transform: rotate(45deg);
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered { padding: 0 2px; display: flex; flex-wrap: wrap; align-items: center; margin: 0; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin: 3px 4px 3px 0;
    padding: 2px 8px 2px 6px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--bt-primary-700, #bd1a3d);
    margin-right: 4px;
    font-weight: 700;
}
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    font-size: 13.5px;
    font-family: inherit;
}
.select2-container--default .select2-selection--multiple .select2-search__field::placeholder { color: #a1b0be; }

/* Before Select2 takes over (page loading), a native multi-select would show as an open list.
   Render it as a collapsed one-line field with the placeholder look instead. */
select.form-select[multiple]:not(.select2-hidden-accessible) {
    height: 38px;
    min-height: 38px;
    overflow: hidden;
    color: transparent;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237c6f99' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .2rem center;
    background-size: 16px 12px;
    scrollbar-width: none;
}
select.form-select[multiple]:not(.select2-hidden-accessible)::-webkit-scrollbar { display: none; }
select.form-select[multiple]:not(.select2-hidden-accessible) option { color: transparent; background: transparent; }
/* multi-select placeholder ("All roles") lives in the inline search field - let it take the free space */
.select2-container--default .select2-selection--multiple .select2-search--inline { flex: 1 1 60px; min-width: 60px; }
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    width: 100% !important;
    margin: 0;
    height: 30px;
    line-height: 30px;
}
/* once something is chosen, the (placeholder) search field should not claim a line of its own */
.select2-container--default .select2-selection--multiple .select2-selection__rendered:has(.select2-selection__choice) .select2-search--inline {
    flex: 0 0 4px;
    min-width: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered:has(.select2-selection__choice) .select2-search__field {
    width: 4px !important;
}

/* field-level error under a control (in-panel save) */
.bt-field-error { color: #dc3545; font-size: 12px; font-weight: 600; margin-top: 4px; }
.bt-field-error::before { content: "\26A0  "; }
.form-control.is-invalid { border-bottom-color: #dc3545 !important; background-image: none; }
button.bt-busy { opacity: .7; pointer-events: none; }
button.bt-busy::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bt-spin .7s linear infinite;
}
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* ---------- Page / save loader ---------- */
.bt-loader {
    position: fixed;
    inset: 0;
    z-index: 3000; /* above modals (1055) and select2 dropdowns */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 249, 251, .55);
    backdrop-filter: blur(1.5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility 0s linear .18s;
}
.bt-loader.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .18s ease;
}
.bt-loader-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--bt-border);
    box-shadow: 0 16px 40px rgba(9, 36, 56, .16);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--bt-ink, #092438);
}
.bt-loader-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #e9eff4;
    border-top-color: var(--bt-primary, #d8234a);
    animation: bt-spin .7s linear infinite;
}

/* employee photo / default avatar in lists: square thumbnail, photo cropped not stretched */
.bt-emp-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--bt-border);
    background: #f2f3f5;
}
.bt-profile-photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    padding: 3px;
    background: #fff;
    border: 2px solid var(--bt-primary, #d8234a);
}

/* breadcrumb: only the first (home) link is an icon box; later links are plain text links */
.page-breadcrumb .breadcrumb li.breadcrumb-item + li.breadcrumb-item a {
    display: inline;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    font-size: inherit;
    color: var(--bt-primary);
    text-decoration: none;
}
.page-breadcrumb .breadcrumb li.breadcrumb-item + li.breadcrumb-item a:hover { text-decoration: underline; }

/* ---------- Employee profile / documents page ---------- */
.bt-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--bt-ink, #092438);
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bt-border);
}
.bt-card-head i { color: var(--bt-primary); font-size: 20px; }

.bt-profile-card .card-body { padding: 24px; }
.bt-profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.bt-profile-name { margin: 6px 0 0; font-size: 17px; font-weight: 700; color: var(--bt-ink, #092438); line-height: 1.3; }
.bt-profile-role {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
}
.bt-profile-info { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--bt-border); }
.bt-profile-info li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--bt-border);
    font-size: 13px;
}
.bt-profile-info li span { display: inline-flex; align-items: center; gap: 8px; color: var(--bt-muted); }
.bt-profile-info li span i { color: var(--bt-primary); font-size: 16px; }
.bt-profile-info li b { font-weight: 600; color: var(--bt-ink, #092438); text-align: right; word-break: break-all; }
.bt-profile-password { margin-top: 18px; }
.bt-profile-password .form-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #637485;
    margin-bottom: 4px;
}
.bt-profile-password .input-group { flex-wrap: nowrap; }
.bt-profile-password .input-group .form-control { border-bottom-style: solid; letter-spacing: .12em; }
.bt-profile-password .input-group-text { cursor: pointer; color: var(--bt-primary); font-size: 18px; }

.bt-doc-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-size: 12.5px; font-weight: 600; color: var(--bt-muted); }
.bt-doc-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: #eef2f5; overflow: hidden; }
.bt-doc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--bt-gradient, var(--bt-primary)); }

.bt-doc-tile {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.bt-doc-tile:hover { border-color: #d6e0eb; box-shadow: 0 6px 18px rgba(9, 36, 56, .06); }
.bt-doc-tile.is-done { background: #fbfdfb; }
.bt-doc-top { display: flex; align-items: flex-start; gap: 12px; }
.bt-doc-icon {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 20px;
}
.bt-doc-tile.is-done .bt-doc-icon { background: #e7f6ee; color: #198754; }
.bt-doc-meta { flex: 1 1 auto; min-width: 0; }
.bt-doc-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--bt-ink, #092438);
    line-height: 1.35;
    /* keep every tile the same height: at most 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 2);
}
.bt-doc-status { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: #9ba9b8; }
.bt-doc-status.done { color: #198754; }
.bt-doc-view {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 12px;
    font-weight: 700;
}
.bt-doc-view:hover { background: var(--bt-primary); color: #fff; }
.bt-doc-tile .bt-doc-file { margin-top: auto; }
.bt-doc-actions { display: flex; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bt-border); }

/* file inputs everywhere (not only in panels): themed "Choose file" button */
input[type="file"].form-control { padding: .35rem 0; font-size: 13px; color: var(--bt-muted); }
input[type="file"].form-control::file-selector-button {
    border: 1px solid #dde2e8;
    border-radius: 8px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-weight: 600;
    padding: .35rem .9rem;
    margin: 0 12px 0 0;
    cursor: pointer;
    transition: background .15s;
}
input[type="file"].form-control:hover::file-selector-button { background: #e9eff4; }

/* ---------- Toast notifications (Lobibox: successAlert / errorAlert / flash messages) ---------- */
.lobibox-notify-wrapper.top.right { top: 76px !important; right: 18px !important; }
.lobibox-notify-wrapper .lobibox-notify {
    --toast: #d8234a;
    --toast-soft: #f2f5f9;
    position: relative;
    display: flex;
    align-items: center;
    min-height: 0;
    width: 360px;
    max-width: calc(100vw - 36px);
    padding: 14px 40px 16px 16px;
    margin: 0 0 10px;
    border: 1px solid #ecf0f3 !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: #1f3342 !important;
    box-shadow: 0 14px 34px rgba(9, 36, 56, .14), 0 2px 6px rgba(9, 36, 56, .06) !important;
    overflow: hidden;
    font-family: inherit;
}
/* coloured accent strip on the left */
.lobibox-notify-wrapper .lobibox-notify::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast);
}
.lobibox-notify-wrapper .lobibox-notify.lobibox-notify-success { --toast: #16a34a; --toast-soft: #e8f7ee; }
.lobibox-notify-wrapper .lobibox-notify.lobibox-notify-error   { --toast: #dc2f45; --toast-soft: #fdecee; }
.lobibox-notify-wrapper .lobibox-notify.lobibox-notify-warning { --toast: #d97706; --toast-soft: #fef4e6; }
.lobibox-notify-wrapper .lobibox-notify.lobibox-notify-info    { --toast: #2563eb; --toast-soft: #eaf1fe; }
.lobibox-notify-wrapper .lobibox-notify:hover { background: #fff !important; border-color: #e2e8ed !important; }

/* icon: tinted circle */
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-icon-wrapper {
    position: static;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-right: 12px;
}
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-icon,
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-icon > div {
    position: static;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-icon > div .icon-el {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--toast-soft);
    color: var(--toast) !important;
    font-size: 21px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

/* text */
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-body { margin: 0; padding: 0; flex: 1 1 auto; min-width: 0; }
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-title {
    font-size: 13px;
    font-weight: 700;
    color: #092438;
    margin: 0 0 2px;
}
.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-msg {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f3342;
    max-height: none !important;
    word-break: break-word;
}

/* close button */
.lobibox-notify-wrapper .lobibox-notify .lobibox-close {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    color: #91a1b0 !important;
    background: transparent;
    opacity: 1;
}
.lobibox-notify-wrapper .lobibox-notify .lobibox-close:hover { background: #f4f6f8; color: #092438 !important; }

/* countdown line along the bottom, in the toast colour */
.lobibox-notify-wrapper .lobibox-notify .lobibox-delay-indicator {
    left: 4px;
    right: 0;
    bottom: 0;
    height: 3px;
    background: transparent;
}
.lobibox-notify-wrapper .lobibox-notify .lobibox-delay-indicator > div { background: var(--toast) !important; opacity: .55; }

.lobibox-notify-wrapper .lobibox-notify .lobibox-notify-icon i { font-size: 21px !important; color: var(--toast) !important; line-height: 1; }

/* ---------- Settings pages (Attendance Settings) ---------- */
.bt-set-card .card-body { padding: 20px 24px 24px; }
.bt-card-head-note { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--bt-muted); }
.bt-help { margin-top: 6px; font-size: 12px; color: var(--bt-muted); }
/* input with a unit on the right ("minutes", "metres") */
.bt-input-unit { position: relative; }
.bt-input-unit .form-control { padding-right: 70px; font-weight: 600; }
.bt-input-unit span {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--bt-muted);
    pointer-events: none;
}
.bt-shift-card {
    height: 100%;
    padding: 16px 18px 18px;
    border: 1px solid var(--bt-border);
    border-radius: 12px;
    background: #fff;
}
.bt-shift-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bt-shift-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.bt-shift-day .bt-shift-icon { background: #fff4e0; color: #d97706; }
.bt-shift-night .bt-shift-icon { background: #e9ebfb; color: #4338ca; }
.bt-shift-name { font-weight: 700; font-size: 14px; color: var(--bt-ink, #092438); }
.bt-shift-hours {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.bt-shift-hours:empty { display: none; }
.bt-shift-card .form-control { font-weight: 600; letter-spacing: .02em; }

/* ---------- Add / Edit Role ---------- */
.bt-role-current {
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 12px;
    font-weight: 700;
}
.bt-role-summary { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--bt-muted); }
.bt-role-summary span { margin-right: auto; }
.bt-role-summary b { color: var(--bt-primary); }
.bt-role-module .card-body { padding: 16px 20px 20px; }
.bt-role-module-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--bt-border); }
.bt-role-module-name { font-weight: 700; font-size: 14.5px; color: var(--bt-ink, #092438); }
.bt-role-module-count { padding: 2px 9px; border-radius: 999px; background: #f4f6f8; color: #637485; font-size: 11.5px; font-weight: 700; }
.bt-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bt-perm {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--bt-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #314554;
    transition: background .12s, border-color .12s;
}
.bt-perm:hover { border-color: #d6e0eb; }
.bt-perm.is-on { background: #f7f9fb; border-color: #cad8e6; color: var(--bt-ink, #092438); font-weight: 600; }
.bt-perm .form-check-input { margin: 0; flex: 0 0 auto; cursor: pointer; }
/* small toggle switch */
.bt-switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: #637485; user-select: none; }
.bt-switch input { position: absolute; opacity: 0; pointer-events: none; }
.bt-switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: #dde2e8; transition: background .15s; }
.bt-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .15s;
}
.bt-switch input:checked + .bt-switch-track { background: var(--bt-primary, #d8234a); }
.bt-switch input:checked + .bt-switch-track::after { transform: translateX(14px); }
.bt-switch input:indeterminate + .bt-switch-track { background: #f09eb0; }
.bt-switch input:indeterminate + .bt-switch-track::after { transform: translateX(7px); }
/* while a slide-in panel is open: still top-right, over the panel title bar, clear of its close button */
body.modal-open .lobibox-notify-wrapper.top.right {
    top: 8px !important;
    right: 64px !important;
    left: auto !important;
    z-index: 3100 !important; /* above the panel */
}

/* ---------- Active / Inactive status toggle (edit panels) + list pill ---------- */
.bt-status-toggle {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border-radius: 12px;
    background: #f4f6f8;
    border: 1px solid var(--bt-border);
}
.bt-status-toggle > label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #637485;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.bt-status-toggle > label i { font-size: 16px; }
.bt-status-toggle > label:hover { color: var(--bt-ink, #092438); }
.bt-status-toggle > .btn-check:checked + label.bt-status-on { background: #fff; color: #15803d; box-shadow: 0 2px 8px rgba(21, 128, 61, .15); }
.bt-status-toggle > .btn-check:checked + label.bt-status-off { background: #fff; color: #b4233f; box-shadow: 0 2px 8px rgba(180, 35, 63, .15); }
.bt-status-toggle > .btn-check:focus-visible + label { outline: 2px solid var(--bt-accent); outline-offset: 1px; }

.bt-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.bt-status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bt-status-pill.on { background: #e8f7ee; color: #15803d; }
.bt-status-pill.off { background: #fdecee; color: #b4233f; }

/* simple edit panels: replace the old <br /> spacing with even gaps */
.modal.bt-modal-right .modal-body .card-body > [class*="col-"] + br { display: none; }
.modal.bt-modal-right .modal-body .card-body > [class*="col-"]:not(.text-end) { margin-bottom: 20px; }

/* ---------- Site map hover card (Dashboard + Site Map, partials/site-map) ---------- */
.bt-site-card {
    position: absolute;
    z-index: 5;
    width: 320px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    overflow: hidden;
    color: #1f2937;
}

.bt-site-card-media {
    position: relative;
    height: 170px;
    background: #f3f4f6;
}

.bt-site-card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* organisation charts are diagrams: show the whole chart, not a crop */
.bt-site-card-img.is-chart {
    object-fit: contain;
    background: #fff;
}

.bt-site-card-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 16px;
    line-height: 32px;
    text-align: center;
    padding: 0;
    cursor: pointer;
}

.bt-site-card-nav:hover {
    background: rgba(0, 0, 0, .8);
}

.bt-site-card-prev {
    left: 8px;
}

.bt-site-card-next {
    right: 8px;
}

.bt-site-card-caption {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
}

.bt-site-card-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
}

.bt-site-card-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .6);
    box-shadow: 0 0 2px rgba(0, 0, 0, .5);
    cursor: pointer;
}

.bt-site-card-dots span.on {
    background: #fff;
}

.bt-site-card-body {
    padding: 10px 12px 12px;
}

.bt-site-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bt-site-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
}

.bt-site-card-addr {
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-line;
}


/* ---------- Site Allocation ---------- */
/* segmented choice (radio buttons rendered as one pill group) */
.bt-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #f4f6f8;
    border: 1px solid var(--bt-border);
}
.bt-seg > label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 7px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #637485;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
.bt-seg > label i { font-size: 16px; }
.bt-seg > label:hover { color: var(--bt-ink, #092438); }
.bt-seg > .btn-check:checked + label { background: #fff; color: var(--bt-primary); box-shadow: 0 2px 8px rgba(216, 35, 74, .15); }
.bt-alloc-filter .bt-filter-head { margin-bottom: 14px; }

#site_allocation_list_box { margin-top: 4px; }
.bt-alloc-panel { height: 640px; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 0; }
.bt-alloc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--bt-border);
    font-weight: 700;
    font-size: 14.5px;
    color: var(--bt-ink, #092438);
}
.bt-alloc-head > i { color: var(--bt-primary); font-size: 19px; }
.bt-alloc-count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
}
.bt-alloc-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--bt-muted); }
.bt-alloc-search { position: relative; padding: 10px 14px 6px; }
.bt-alloc-search i { position: absolute; left: 24px; top: 50%; transform: translateY(-35%); color: #9ba9b8; }
.bt-alloc-search .form-control { padding-left: 32px !important; border: 1px solid #dde2e8 !important; border-radius: 9px !important; background: #fff !important; }
.bt-alloc-scroll { flex: 1 1 auto; overflow: auto; padding: 10px 14px 14px; }

/* employee chip */
.bt-alloc-emp {
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: 1px solid var(--bt-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    cursor: grab !important;
    transition: box-shadow .12s, border-color .12s;
}
.bt-alloc-emp:hover { border-color: #cad8e6 !important; box-shadow: 0 4px 12px rgba(216, 35, 74, .12) !important; }
.bt-alloc-emp.ui-draggable-dragging { cursor: grabbing !important; box-shadow: 0 12px 28px rgba(9, 36, 56, .22) !important; z-index: 50; }
.bt-alloc-emp-body { display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
.bt-alloc-avatar {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bt-soft);
    color: var(--bt-primary);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bt-alloc-emp-name { font-size: 13px; font-weight: 600; color: #1f3342; line-height: 1.3; }
.bt-alloc-pool { min-height: 120px; }
.bt-alloc-empty { display: none; padding: 24px 8px; text-align: center; color: var(--bt-muted); font-size: 12.5px; }

/* site drop zones */
.bt-alloc-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.bt-alloc-site {
    min-height: 96px;
    padding: 10px;
    border: 1.5px dashed #d9e1e9;
    border-radius: 12px;
    background: #fafbfd;
    transition: border-color .12s, background .12s;
}
.bt-alloc-site.has-staff { border-style: solid; border-color: var(--bt-border); background: #fff; }
.bt-alloc-site.ui-droppable-hover,
.bt-alloc-site:has(#dropText) { border-color: var(--bt-primary); background: #f7f9fb; }
.bt-alloc-site-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bt-alloc-site-img { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.bt-alloc-site-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--bt-soft); color: var(--bt-primary); font-size: 17px; }
.bt-alloc-site-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 13px; color: var(--bt-ink, #092438); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#site_allocation_list_box #dropText {
    margin: 4px 0 0;
    padding: 10px;
    border-radius: 9px;
    background: #f1f4f8;
    color: var(--bt-primary);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
}
.bt-alloc-filter .form-label { display: block; margin-bottom: 6px; }

/* ---------- Site Allocation V2 (sheet) ---------- */
.bt-v2-card .card-body { padding: 16px 20px 20px; }
.bt-v2-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bt-v2-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.bt-v2-stats span { padding: 5px 12px; border-radius: 999px; background: #f4f6f8; font-size: 12.5px; color: #425262; }
.bt-v2-stats span b { color: var(--bt-ink, #092438); }
.bt-v2-stats span.ok { background: #e8f7ee; color: #15803d; }
.bt-v2-stats span.ok b { color: #15803d; }
.bt-v2-stats span.warn { background: #fff4e0; color: #b45309; }
.bt-v2-stats span.warn b { color: #b45309; }
.bt-v2-tools { display: flex; gap: 10px; align-items: center; }
.bt-v2-tools .bt-alloc-search { padding: 0; width: 240px; }
.bt-v2-tools .bt-alloc-search i { left: 10px; transform: translateY(-50%); }
.bt-v2-show { width: auto !important; min-width: 170px; border: 1px solid #dde2e8 !important; border-radius: 9px !important; padding: .4rem 2rem .4rem .7rem !important; background-color: #fff !important; }
.bt-v2-bulk {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f7f9fb;
    border: 1px solid #e2eaf1;
    font-size: 13px;
    color: var(--bt-ink, #092438);
}
.bt-v2-bulk select { width: 260px !important; border: 1px solid #dde2e8 !important; border-radius: 9px !important; padding: .35rem 2rem .35rem .7rem !important; background-color: #fff !important; }
.bt-v2-table-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--bt-border); border-radius: 12px; }
.bt-v2-table thead th { position: sticky; top: 0; z-index: 2; }
.bt-v2-table td { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }
.bt-v2-table tr.is-changed td { background: #fafbfd; }
.bt-v2-table tr.is-locked td { color: var(--bt-muted); }
.bt-v2-emp { display: flex; align-items: center; gap: 10px; }
.bt-v2-name { font-weight: 600; font-size: 13.5px; color: var(--bt-ink, #092438); }
.bt-v2-sub { font-size: 12px; color: var(--bt-muted); }
.bt-v2-table .bt-v2-site {
    display: inline-block;
    width: calc(100% - 18px) !important;
    border: 1px solid #dde2e8 !important;
    border-radius: 9px !important;
    padding: .38rem 2rem .38rem .7rem !important;
    background-color: #fff !important;
    font-size: 13px;
}
.bt-v2-table tr.is-changed .bt-v2-site { border-color: var(--bt-primary) !important; }
.bt-v2-dot { display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--bt-primary); vertical-align: middle; }
.bt-v2-other { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: #f4f6f8; font-size: 12.5px; color: #637485; }
.bt-v2-empty { padding: 30px !important; text-align: center; color: var(--bt-muted); }
/* V2: styled dropdowns in the sheet, shift badges, notes */
.bt-v2-show-wrap { width: 190px; }
.bt-v2-bulk-site { width: 280px; }
.bt-v2-bulk .select2-container--default .select2-selection--single { background: #fff !important; border: 1px solid #dde2e8 !important; border-radius: 9px !important; padding-left: 6px; }
.bt-v2-site-cell { display: flex; align-items: center; gap: 8px; }
.bt-v2-site-cell .select2-container { flex: 1 1 auto; }
.bt-v2-table .select2-container--default .select2-selection--single { border: 1px solid #dde2e8 !important; border-radius: 9px !important; padding-left: 6px; min-height: 36px; background: #fff !important; }
.bt-v2-table tr.is-changed .select2-container--default .select2-selection--single { border-color: var(--bt-primary) !important; box-shadow: 0 0 0 3px rgba(216, 35, 74, .1); }
.bt-v2-dot { visibility: hidden; flex: 0 0 8px; margin-left: 0; }
.bt-v2-table tr.is-changed .bt-v2-dot { visibility: visible; }
.bt-v2-shift { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bt-v2-shift.day { background: #fff4e0; color: #b45309; }
.bt-v2-shift.night { background: #e9ebfb; color: #4338ca; }
.bt-v2-shift.relief { background: #e8f7ee; color: #15803d; }
.bt-v2-note { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; color: var(--bt-muted); }
.bt-v2-note.warn { color: #b45309; }
.bt-v2-table tr[hidden] { display: none; }

/* ---------- Guard Tour details ---------- */
.bt-gt-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.bt-gt-summary > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--bt-border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--bt-muted);
}
.bt-gt-summary > div span { font-size: 18px; font-weight: 700; color: var(--bt-ink, #092438); }
.bt-gt-summary > div.ok span { color: #15803d; }
.bt-gt-summary > div.warn span { color: #b45309; }
.bt-gt-card .card-body { padding: 18px 22px 20px; }
.bt-gt-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--bt-border); }
.bt-gt-num {
    flex: 0 0 28px; height: 28px; border-radius: 50%;
    background: var(--bt-gradient, var(--bt-primary)); color: #fff;
    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.bt-gt-emp { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.bt-gt-photo { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; border: 1px solid var(--bt-border); flex: 0 0 46px; }
.bt-gt-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--bt-soft); color: var(--bt-primary); font-weight: 700; font-size: 15px; }
.bt-gt-name { font-weight: 700; font-size: 15px; color: var(--bt-ink, #092438); }
.bt-gt-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--bt-muted); }
.bt-gt-sub i, .bt-gt-where i { margin-right: 4px; color: var(--bt-primary); vertical-align: -2px; }
.bt-gt-where { flex: 1 1 260px; font-weight: 600; font-size: 13.5px; color: var(--bt-ink, #092438); display: flex; flex-direction: column; gap: 3px; }
.bt-gt-status { margin-left: auto; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bt-gt-status.completed { background: #e8f7ee; color: #15803d; }
.bt-gt-status.in-progress { background: #eaf1fe; color: #1d4ed8; }
.bt-gt-status.incomplete { background: #fdecee; color: #b4233f; }
.bt-gt-status.not-started { background: #f4f6f8; color: #637485; }

.bt-gt-times { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(220px, 1.4fr); gap: 12px; padding: 14px 0; }
.bt-gt-time, .bt-gt-progress { padding: 10px 14px; border-radius: 10px; background: #fafbfd; border: 1px solid var(--bt-border); }
.bt-gt-time .lbl, .bt-gt-progress .lbl { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #8293a3; margin-bottom: 3px; }
.bt-gt-time .lbl i { font-size: 15px; color: var(--bt-primary); }
.bt-gt-time b { font-size: 13.5px; font-weight: 600; color: var(--bt-ink, #092438); }
.bt-gt-bar { height: 8px; border-radius: 999px; background: #eef2f5; overflow: hidden; margin-top: 8px; }
.bt-gt-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #16a34a); }

/* checkpoint timeline */
.bt-gt-points { list-style: none; margin: 0; padding: 0; position: relative; }
.bt-gt-points li { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 10px 0 10px 2px; }
.bt-gt-points li + li { border-top: 1px dashed var(--bt-border); }
.bt-gt-points li:not(:last-child)::after {
    content: ""; position: absolute; left: 15px; top: 40px; bottom: -12px; width: 2px; background: #eaeef3; z-index: 0;
}
.bt-gt-dot { position: relative; z-index: 1; flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; }
.bt-gt-points li.scanned .bt-gt-dot { background: #16a34a; }
.bt-gt-points li.skipped .bt-gt-dot { background: #d97706; }
.bt-gt-points li.missed .bt-gt-dot { background: #dc2f45; }
.bt-gt-point { flex: 1 1 auto; min-width: 0; padding-top: 3px; }
.bt-gt-point-name { font-weight: 600; font-size: 13.5px; color: var(--bt-ink, #092438); }
.bt-gt-remark { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #fafbfd; border: 1px solid var(--bt-border); font-size: 12.5px; color: #425262; white-space: pre-line; }
.bt-gt-remark i { color: var(--bt-primary); margin-right: 4px; vertical-align: -2px; }
.bt-gt-point-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; padding-top: 3px; min-width: 190px; }
.bt-gt-pill { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.bt-gt-pill.scanned { background: #e8f7ee; color: #15803d; }
.bt-gt-pill.skipped { background: #fff4e0; color: #b45309; }
.bt-gt-pill.missed { background: #fdecee; color: #b4233f; }
.bt-gt-empty { text-align: center; padding: 40px !important; color: var(--bt-muted); }
.bt-gt-empty i { font-size: 40px; color: #cdd9e5; display: block; margin-bottom: 8px; }
@media (max-width: 991.98px) {
    .bt-gt-times { grid-template-columns: 1fr 1fr; }
    .bt-gt-status { margin-left: 0; }
    .bt-gt-point-meta { min-width: 0; }
}
/* checkpoint photos */
.bt-gt-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bt-gt-photos a {
    display: block;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--bt-border);
    background: #f4f6f8;
    transition: box-shadow .15s, transform .15s;
}
.bt-gt-photos a:hover { box-shadow: 0 6px 16px rgba(9, 36, 56, .18); transform: translateY(-1px); }
.bt-gt-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bt-gt-photos a.is-missing { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--bt-muted); }
.bt-gt-photos a.is-missing::after { content: "Photo unavailable"; text-align: center; padding: 4px; }

/* ---------- Photo viewer (lightbox) ---------- */
.bt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 72px;
    background: rgba(7, 23, 34, .86);
    backdrop-filter: blur(3px);
    animation: bt-lb-in .15s ease-out;
}
.bt-lightbox[hidden] { display: none; }
@keyframes bt-lb-in { from { opacity: 0; } to { opacity: 1; } }
.bt-lb-figure {
    margin: 0;
    max-width: min(1100px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.bt-lb-figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    border-radius: 14px;
    background: #1f3342;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    object-fit: contain;
    transition: opacity .15s;
}
.bt-lightbox.is-loading img { opacity: .35; }
.bt-lb-figure figcaption {
    width: 100%;
    max-width: 640px;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    color: #1f3342;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.bt-lb-title { font-weight: 700; font-size: 14.5px; color: #092438; }
.bt-lb-sub { margin-top: 2px; font-size: 13px; color: #637485; white-space: pre-line; }
.bt-lb-sub:empty { display: none; }
.bt-lb-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.bt-lb-count { font-size: 12px; font-weight: 700; color: var(--bt-primary, #d8234a); }
.bt-lb-close, .bt-lb-nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}
.bt-lb-close:hover, .bt-lb-nav:hover { background: rgba(255, 255, 255, .28); }
.bt-lb-close { top: 18px; right: 20px; width: 42px; height: 42px; font-size: 26px; }
.bt-lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; }
.bt-lb-nav.prev { left: 16px; }
.bt-lb-nav.next { right: 16px; }
.bt-lightbox.single .bt-lb-nav { display: none; }
.bt-gt-photos a { cursor: zoom-in; position: relative; }
.bt-gt-photos a::before {
    content: "View"; /* hover hint */
    font-weight: 700;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: rgba(9, 36, 56, .35);
    opacity: 0;
    transition: opacity .15s;
}
.bt-gt-photos a:hover::before { opacity: 1; }
.bt-gt-photos a.is-missing::before { display: none; }
@media (max-width: 575.98px) {
    .bt-lightbox { padding: 60px 12px 16px; }
    .bt-lb-nav { top: auto; bottom: 18px; transform: none; }
}

/* ===== Routes & Checkpoints (one page per site) ===== */
.bt-rs-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 991px) { .bt-rs-wrap { grid-template-columns: 1fr; } }
.bt-rs-card { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); }
.bt-rs-card .bt-rs-head { padding: 14px 16px; border-bottom: 1px solid var(--bt-border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-rs-card .bt-rs-body { padding: 14px 16px; }
.bt-rs-title { font-weight: 700; color: var(--bt-ink); font-size: 15px; margin: 0; }
.bt-rs-muted { color: var(--bt-muted); font-size: 12px; }
.bt-rs-side { position: sticky; top: 80px; }
.bt-rs-new { display: grid; gap: 8px; padding: 12px; background: var(--bt-soft); border-radius: var(--bt-radius-sm); margin-bottom: 12px; }
.bt-rs-new .form-control { background: transparent; }
.bt-rs-new .bt-rs-new-row { display: flex; gap: 8px; align-items: end; }
.bt-rs-new .bt-rs-new-row > :first-child { flex: 1; min-width: 0; }
.bt-rs-routes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: calc(100vh - 360px); overflow: auto; }
.bt-rs-route { width: 100%; text-align: left; border: 1px solid var(--bt-border); background: #fff; border-radius: var(--bt-radius-sm); padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; transition: border-color .15s, background .15s; }
.bt-rs-route:hover { border-color: var(--bt-accent); }
.bt-rs-route.is-active { border-color: var(--bt-primary); background: var(--bt-soft); box-shadow: inset 3px 0 0 var(--bt-primary); }
.bt-rs-route .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-size: 18px; flex: none; }
.bt-rs-route.is-active .ic { background: var(--bt-primary); color: #fff; }
.bt-rs-route .nm { font-weight: 600; color: var(--bt-ink); font-size: 13px; line-height: 1.3; word-break: break-word; }
.bt-rs-route .meta { font-size: 11.5px; color: var(--bt-muted); }
.bt-rs-route .meta .warn { color: #b45309; }
.bt-rs-route .off { margin-left: auto; font-size: 10.5px; font-weight: 600; color: #b4233f; background: #fdecee; padding: 2px 8px; border-radius: 20px; flex: none; }
.bt-rs-route .dirty { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex: none; }
.bt-rs-empty { text-align: center; color: var(--bt-muted); padding: 36px 16px; }
.bt-rs-empty i { font-size: 40px; color: var(--bt-accent); display: block; margin-bottom: 8px; }
.bt-rs-name { flex: 1; min-width: 200px; font-weight: 700; font-size: 15px !important; color: var(--bt-ink); }
.bt-rs-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-rs-stats span { background: var(--bt-bg); border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--bt-text); }
.bt-rs-stats b { color: var(--bt-ink); }
.bt-rs-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--bt-muted); background: #fafbfc; border: 1px dashed var(--bt-border); border-radius: var(--bt-radius-sm); padding: 8px 12px; margin-bottom: 12px; }
.bt-rs-tip i { color: var(--bt-primary); font-size: 16px; }
.bt-rs-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.bt-rs-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--bt-muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--bt-border); white-space: nowrap; }
.bt-rs-table td { padding: 4px 6px; border-bottom: 1px solid #f2f4f7; vertical-align: top; }
.bt-rs-table td.num { color: var(--bt-muted); font-size: 12px; width: 34px; padding-top: 12px; text-align: center; }
.bt-rs-table td.act { width: 92px; white-space: nowrap; padding-top: 8px; }
.bt-rs-table .form-control { padding-left: 2px; padding-right: 2px; font-size: 13px; }
.bt-rs-table tr.is-new td.num { color: var(--bt-primary); font-weight: 700; }
.bt-rs-table tr.is-off .form-control { color: var(--bt-muted); text-decoration: line-through; }
.bt-rs-table tr.is-changed td.num { box-shadow: inset 3px 0 0 #f59e0b; }
.bt-rs-table .bt-field-error { font-size: 11px; }
.bt-rs-nfc { position: relative; }
.bt-rs-nfc .form-control { padding-left: 24px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }
.bt-rs-nfc > i { position: absolute; left: 4px; top: 9px; color: var(--bt-accent); font-size: 15px; pointer-events: none; }
.bt-rs-switch { position: relative; display: inline-block; width: 34px; height: 20px; vertical-align: middle; }
.bt-rs-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.bt-rs-switch span { position: absolute; inset: 0; background: #dadee3; border-radius: 20px; cursor: pointer; transition: background .15s; }
.bt-rs-switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.bt-rs-switch input:checked + span { background: #16a34a; }
.bt-rs-switch input:checked + span::after { transform: translateX(14px); }
.bt-rs-switch input:focus-visible + span { outline: 2px solid var(--bt-accent); outline-offset: 2px; }
.bt-rs-del { border: 0; background: transparent; color: #b4233f; font-size: 18px; padding: 0 6px; vertical-align: middle; border-radius: 6px; }
.bt-rs-del:hover { background: #fdecee; }
.bt-rs-addbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bt-rs-paste { margin-top: 12px; padding: 12px; background: var(--bt-soft); border-radius: var(--bt-radius-sm); }
.bt-rs-paste textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; background: #fff !important; border: 1px solid var(--bt-border) !important; border-radius: 8px !important; padding: 8px 10px !important; }
.bt-rs-savebar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--bt-border); padding: 12px 16px; display: flex; gap: 8px; align-items: center; border-radius: 0 0 var(--bt-radius) var(--bt-radius); z-index: 2; }
.bt-rs-savebar .state { font-size: 12px; color: var(--bt-muted); margin-right: auto; display: flex; align-items: center; gap: 6px; }
.bt-rs-savebar .state.dirty { color: #b45309; font-weight: 600; }
.bt-rs-savebar .state.dirty::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }

/* ===== Site Reports page ===== */
.bt-report-card { height: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); transition: box-shadow .2s, transform .2s; }
.bt-report-card:hover { box-shadow: var(--bt-shadow-lg); }
.bt-report-head { display: flex; gap: 14px; padding: 20px 20px 14px; align-items: flex-start; }
.bt-report-head h6 { margin: 0 0 4px; font-weight: 700; color: var(--bt-ink); font-size: 16px; }
.bt-report-head p { margin: 0; color: var(--bt-muted); font-size: 12.5px; line-height: 1.5; }
.bt-report-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--bt-gradient); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 6px 14px rgba(216, 35, 74, .25); }
.bt-report-body { padding: 4px 20px 8px; flex: 1; }
.bt-report-stat { display: inline-flex; gap: 6px; align-items: baseline; background: var(--bt-soft); color: var(--bt-text); border-radius: 20px; padding: 4px 12px; font-size: 12px; margin-bottom: 14px; }
.bt-report-stat b { color: var(--bt-primary); font-size: 14px; }
.bt-report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--bt-text); }
.bt-report-list i { color: #16a34a; margin-right: 6px; }
.bt-report-check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--bt-text); cursor: pointer; }
.bt-report-check .form-check-input { margin: 0; }
.bt-report-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bt-report-quick button { border: 1px solid var(--bt-border); background: #fff; color: var(--bt-text); border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.bt-report-quick button:hover { border-color: var(--bt-accent); color: var(--bt-primary); }
.bt-report-quick button.is-active { background: var(--bt-primary); border-color: var(--bt-primary); color: #fff; }
.bt-report-foot { padding: 14px 20px 18px; border-top: 1px solid var(--bt-border); display: flex; justify-content: flex-end; }

/* empty list message under a paged table */
.bt-list-empty { text-align: center; color: var(--bt-muted); padding: 28px 12px; font-size: 13px; border-bottom: 1px solid var(--bt-border); }
.bt-list-empty i { display: block; font-size: 30px; color: var(--bt-accent); margin-bottom: 6px; }

/* ===== Dashboard (operations overview) ===== */
.bt-dash .bt-dash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.bt-dash .bt-dash-actions a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12.5px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .18); transition: background .15s; }
.bt-dash .bt-dash-actions a:hover { background: rgba(255, 255, 255, .24); }
.bt-dash .bt-dash-actions i { font-size: 16px; }
.bt-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.bt-kpi { --c1: #fb577b; --c2: #bc193c; --soft: #f3f6f9; position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); color: var(--bt-text); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.bt-kpi:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-lg); color: var(--bt-text); }
.bt-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.bt-kpi.is-violet { --c1: #fb577b; --c2: #bc193c; --soft: #f3f6f9; }
.bt-kpi.is-teal { --c1: #22c3a6; --c2: #0f8f7a; --soft: #e3f7f3; }
.bt-kpi.is-amber { --c1: #ffb547; --c2: #f07b12; --soft: #fff3e0; }
.bt-kpi.is-green { --c1: #34d399; --c2: #15803d; --soft: #e8f7ee; }
.bt-kpi.is-blue { --c1: #60a5fa; --c2: #1d4ed8; --soft: #eaf1fe; }
.bt-kpi.is-rose { --c1: #fb7185; --c2: #be123c; --soft: #fdecee; }
.bt-kpi-icon { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--c2); font-size: 20px; }
.bt-kpi-label { font-size: 12px; font-weight: 600; color: var(--bt-muted); padding-right: 44px; }
.bt-kpi-value { font-size: 28px; font-weight: 800; color: var(--bt-ink); line-height: 1.15; margin-top: 4px; }
.bt-kpi-value small { font-size: 13px; font-weight: 600; color: var(--bt-muted); }
.bt-kpi-sub { font-size: 12px; color: var(--bt-muted); margin-top: 2px; }
.bt-kpi-sub b { font-weight: 700; }
.bt-kpi-sub .bt-up { color: #be123c; }
.bt-kpi-sub .bt-down { color: #15803d; }
.bt-kpi-bar { display: block; height: 5px; background: var(--soft); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.bt-kpi-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.bt-attn { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bt-attn.is-clear { color: #15803d; font-weight: 600; font-size: 13px; }
.bt-attn.is-clear i { font-size: 20px; }
.bt-attn-title { font-weight: 700; color: var(--bt-ink); font-size: 13px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bt-attn-title i { color: var(--bt-primary); font-size: 18px; }
.bt-attn-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.bt-attn-item { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; border: 1px solid transparent; transition: filter .15s; }
.bt-attn-item:hover { filter: brightness(.97); }
.bt-attn-item b { font-size: 14px; }
.bt-attn-item i { font-size: 16px; }
.bt-attn-item.is-danger { background: #fdecee; color: #9f1239; border-color: #fbd0d7; }
.bt-attn-item.is-warn { background: #fff4e0; color: #92400e; border-color: #fde3b5; }
.bt-attn-item.is-info { background: #eef2ff; color: #3730a3; border-color: #dfe3ff; }
.bt-panel { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); padding: 16px 18px; height: 100%; display: flex; flex-direction: column; }
.bt-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bt-panel-head h6 { margin: 0; font-weight: 700; color: var(--bt-ink); font-size: 14.5px; }
.bt-panel-head small { color: var(--bt-muted); font-size: 12px; }
.bt-panel-head .bt-icon-badge { margin-right: 0; }
.bt-panel-link { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.bt-panel-empty { text-align: center; color: var(--bt-muted); font-size: 13px; padding: 26px 10px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.bt-panel-empty i { font-size: 30px; color: var(--bt-accent); margin-bottom: 6px; }
.bt-chart { position: relative; }
.bt-chart-donut { max-width: 230px; margin: 0 auto; width: 100%; }
.bt-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.bt-donut-center b { font-size: 24px; font-weight: 800; color: var(--bt-ink); line-height: 1; }
.bt-donut-center span { font-size: 11.5px; color: var(--bt-muted); margin-top: 4px; }
.bt-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.bt-legend li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--bt-text); }
.bt-legend li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bt-legend li b { margin-left: auto; color: var(--bt-ink); }
.bt-shift-split { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--bt-border); }
.bt-shift-split > div { display: grid; grid-template-columns: 1fr auto; font-size: 12px; color: var(--bt-muted); row-gap: 4px; }
.bt-shift-split b { color: var(--bt-ink); }
.bt-shift-split i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--bt-gradient); display: block; }
.bt-cov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bt-cov-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--bt-muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--bt-border); white-space: nowrap; }
.bt-cov-table td { padding: 10px 8px; border-bottom: 1px solid #f4f6f8; vertical-align: middle; color: var(--bt-text); }
.bt-cov-table tr:last-child td { border-bottom: 0; }
.bt-cov-table td small { color: var(--bt-muted); font-size: 11.5px; }
.bt-cov-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.bt-cov-dot.ok { background: #16a34a; }
.bt-cov-dot.part { background: #f59e0b; }
.bt-cov-dot.none { background: #e11d48; }
.bt-cov-bar { height: 6px; background: #f2f4f7; border-radius: 4px; overflow: hidden; min-width: 90px; margin-bottom: 3px; }
.bt-cov-bar i { display: block; height: 100%; border-radius: 4px; }
.bt-cov-bar i.ok { background: #16a34a; }
.bt-cov-bar i.part { background: #f59e0b; }
.bt-cov-bar i.none { background: #e11d48; }
.bt-cov-pill { display: inline-block; background: var(--bt-soft); color: var(--bt-primary); border-radius: 20px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.bt-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 14px; }
.bt-mini-stats > div { background: var(--bt-bg); border-radius: 10px; padding: 8px; text-align: center; }
.bt-mini-stats b { display: block; font-size: 18px; color: var(--bt-ink); }
.bt-mini-stats span { font-size: 11px; color: var(--bt-muted); }
.bt-mini-stats .warn { background: #fff4e0; }
.bt-mini-stats .warn b { color: #b45309; }
.bt-feed-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f4f6f8; }
.bt-feed-item:last-child { border-bottom: 0; }
.bt-feed-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.bt-feed-icon.incidents { background: #fdecee; color: #be123c; }
.bt-feed-icon.occurrences { background: var(--bt-soft); color: var(--bt-primary); }
.bt-feed-body { min-width: 0; flex: 1; }
.bt-feed-title { font-weight: 600; color: var(--bt-ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-feed-title span { font-weight: 400; color: var(--bt-muted); }
.bt-feed-sub { font-size: 12px; color: var(--bt-muted); }
.bt-feed-time { font-size: 11.5px; color: var(--bt-muted); white-space: nowrap; }
/* six KPI cards: two even rows of three on wide screens */
@media (min-width: 1200px) { .bt-kpis:has(> :nth-child(6)) { grid-template-columns: repeat(3, 1fr); } .bt-kpis:has(> :nth-child(4)):not(:has(> :nth-child(5))) { grid-template-columns: repeat(4, 1fr); } }
.bt-chart-fill { flex: 1; min-height: 260px; }

/* ===== Dashboard: guard tour focus ===== */
.bt-icon-badge.is-red { background: #fdecee; color: #be123c; }
.bt-cov-site { font-weight: 600; color: var(--bt-ink); }
.bt-cov-route { font-size: 11.5px; color: var(--bt-muted); padding-left: 16px; margin-top: 1px; }
.bt-tag { display: inline-block; border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin: 1px 2px; white-space: nowrap; }
.bt-tag.ok { background: #e8f7ee; color: #15803d; }
.bt-tag.bad { background: #fdecee; color: #be123c; }
.bt-tag.info { background: #eaf1fe; color: #1d4ed8; }
.bt-mini-stats .bad { background: #fdecee; }
.bt-mini-stats .bad b { color: #be123c; }
.bt-rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f4f6f8; }
.bt-rank-item:last-child { border-bottom: 0; }
.bt-rank-body { flex: 1; min-width: 0; }
.bt-rank-title { font-weight: 600; color: var(--bt-ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rank-sub { font-size: 11.5px; color: var(--bt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rank-num { flex: none; min-width: 40px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.bt-rank-num.bad { background: #fdecee; color: #be123c; }
.bt-rank-avatar { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.bt-rank-pct { flex: none; font-weight: 800; font-size: 14px; min-width: 46px; text-align: right; }
.bt-rank-pct.ok { color: #15803d; }
.bt-rank-pct.part { color: #b45309; }
.bt-rank-pct.none { color: #be123c; }
.bt-feed-icon.scan { background: #e8f7ee; color: #15803d; }
.bt-feed-icon.skip { background: #fff4e0; color: #b45309; }
.bt-feed-chip { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; background: var(--bt-soft); color: var(--bt-primary); border-radius: 20px; padding: 0 7px; font-size: 10.5px; font-weight: 600; }
.bt-feed-chip.warn { background: #fff4e0; color: #b45309; }
.bt-feed-remark { margin-left: 6px; font-style: italic; }
.bt-rank-pct small { display: block; font-size: 10px; font-weight: 600; color: var(--bt-muted); }
.bt-cov-table td, .bt-cov-table th { padding-left: 6px; padding-right: 6px; }
.bt-cov-table td:last-child { white-space: nowrap; }

/* ===== Client Info (company profile) ===== */
.bt-co-wrap { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1199px) { .bt-co-wrap { grid-template-columns: 1fr; } }
.bt-co-side { display: grid; gap: 18px; }
.bt-co-card { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); }
.bt-co-profile { overflow: hidden; text-align: center; padding-bottom: 6px; }
.bt-co-cover { height: 86px; background: var(--bt-gradient); position: relative; }
.bt-co-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .22), transparent 45%); }
.bt-co-logo { width: 104px; height: 104px; margin: -52px auto 0; position: relative; border-radius: 22px; background: #fff; box-shadow: 0 10px 26px rgba(9, 36, 56, .16); display: grid; place-items: center; padding: 10px; }
.bt-co-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bt-co-logo span { font-size: 34px; font-weight: 800; color: var(--bt-primary); }
.bt-co-name { margin: 14px 16px 6px; font-weight: 800; color: var(--bt-ink); font-size: 20px; }
.bt-co-reg { display: inline-flex; align-items: center; gap: 5px; background: var(--bt-soft); color: var(--bt-primary); border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.bt-co-contact { list-style: none; margin: 16px 0 0; padding: 0 18px; text-align: left; }
.bt-co-contact li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid #f2f4f7; font-size: 13px; color: var(--bt-text); }
.bt-co-contact li i { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-size: 17px; }
.bt-co-contact li span, .bt-co-contact li a { padding-top: 6px; word-break: break-word; }
.bt-co-contact li a { color: var(--bt-text); font-weight: 600; }
.bt-co-contact li a:hover { color: var(--bt-primary); }

/* management chart card */
.bt-co-chart { padding: 16px; }
.bt-co-chart-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.bt-co-chart-head h6 { margin: 0; font-weight: 700; color: var(--bt-ink); }
.bt-co-chart-head small { color: var(--bt-muted); font-size: 11.5px; }
.bt-co-chart-head .bt-icon-badge { margin-right: 0; }
.bt-co-chart-preview, .bt-co-chart-pdf { position: relative; display: block; width: 100%; height: 260px; border: 1px solid var(--bt-border); border-radius: 12px; overflow: hidden; padding: 0; cursor: zoom-in;
    background: #fafbfc repeating-conic-gradient(#f4f6f8 0% 25%, transparent 0% 50%) 50% / 18px 18px; }
.bt-co-chart-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .3s; }
.bt-co-chart-preview:hover img { transform: scale(1.03); }
.bt-co-chart-pdf iframe { width: 100%; height: 100%; border: 0; pointer-events: none; background: #fff; }
.bt-co-chart-cover { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-in; }
.bt-co-chart-zoom { position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 6px); opacity: 0; transition: opacity .2s, transform .2s; background: rgba(9, 36, 56, .82); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bt-co-chart-preview:hover .bt-co-chart-zoom, .bt-co-chart-pdf:hover .bt-co-chart-zoom, .bt-co-chart-preview:focus-visible .bt-co-chart-zoom { opacity: 1; transform: translate(-50%, 0); }
.bt-co-chart-file, .bt-co-chart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 18px; border: 1.5px dashed var(--bt-border); border-radius: 12px; color: var(--bt-muted); font-size: 12.5px; }
.bt-co-chart-file i, .bt-co-chart-empty i { font-size: 42px; color: var(--bt-accent); }
.bt-co-chart-file b, .bt-co-chart-empty b { color: var(--bt-ink); font-size: 13.5px; }
.bt-co-chart-empty { cursor: pointer; }
.bt-co-chart-empty:hover { border-color: var(--bt-accent); background: #fafbfd; }
.bt-co-chart-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bt-co-chart-actions .btn { flex: 1; }

/* form */
.bt-co-form { padding: 6px 22px 20px; }
.bt-co-section { padding: 18px 0; border-bottom: 1px solid #f2f4f7; }
.bt-co-section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--bt-ink); font-size: 14px; margin-bottom: 6px; }
.bt-co-section-title i { width: 30px; height: 30px; border-radius: 9px; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-size: 16px; }
.bt-co-prefix { display: flex; align-items: flex-end; gap: 6px; }
.bt-co-prefix span { font-size: 13.5px; color: var(--bt-muted); padding-bottom: 8px; font-weight: 600; }
.bt-co-prefix .form-control { flex: 1; }
.bt-co-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1.5px dashed var(--bt-border); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; margin: 0; }
.bt-co-drop:hover, .bt-co-drop.is-over { border-color: var(--bt-accent); background: #fafbfd; }
.bt-co-drop.has-file { border-style: solid; border-color: var(--bt-primary); }
.bt-co-drop-thumb { flex: none; width: 58px; height: 58px; border-radius: 10px; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.bt-co-drop-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bt-co-drop-text { display: flex; flex-direction: column; min-width: 0; }
.bt-co-drop-text b { color: var(--bt-ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-co-drop-text small { color: var(--bt-muted); font-size: 11.5px; }
.bt-co-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bt-co-remove { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: #b4233f; cursor: pointer; }
.bt-co-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; }

/* full-screen chart viewer */
.bt-cv { position: fixed; inset: 0; z-index: 3000; background: rgba(5, 20, 31, .94); display: flex; flex-direction: column; }
.bt-cv[hidden] { display: none; }
.bt-cv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-wrap: wrap; }
.bt-cv-title { font-weight: 700; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.bt-cv-title i { font-size: 20px; color: #cbd9e6; }
.bt-cv-title span { font-weight: 400; color: #daa7b2; font-size: 13px; }
.bt-cv-tools { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 3px; }
.bt-cv-tools button, .bt-cv-tools a { border: 0; background: transparent; color: #fff; height: 34px; min-width: 34px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 600; }
.bt-cv-tools button i, .bt-cv-tools a i { font-size: 19px; }
.bt-cv-tools button:hover, .bt-cv-tools a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.bt-cv-level { min-width: 52px; text-align: center; font-size: 12.5px; color: #dae2eb; font-variant-numeric: tabular-nums; }
.bt-cv-stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bt-cv-stage img { max-width: none; transform-origin: center center; cursor: grab; user-select: none; touch-action: none; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.bt-cv-stage img.is-drag { cursor: grabbing; }
.bt-cv-stage iframe { width: min(1200px, 96vw); height: 100%; border: 0; background: #fff; }
.bt-cv-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #daa7b2; font-size: 12px; background: rgba(0, 0, 0, .35); padding: 5px 12px; border-radius: 20px; pointer-events: none; }

/* ===== Roles (card grid) ===== */
.bt-role-limit { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #b45309; background: #fff4e0; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.bt-role-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); padding: 12px 14px; margin-bottom: 16px; }
.bt-role-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.bt-role-stats > div { display: flex; align-items: baseline; gap: 6px; background: var(--bt-bg); border-radius: 10px; padding: 7px 12px; }
.bt-role-stats b { font-size: 18px; color: var(--bt-ink); }
.bt-role-stats span { font-size: 12px; color: var(--bt-muted); }
.bt-role-stats .warn { background: #fff4e0; }
.bt-role-stats .warn b { color: #b45309; }
.bt-role-search { position: relative; flex: 1; min-width: 220px; max-width: 420px; margin-left: auto; }
.bt-role-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bt-muted); font-size: 18px; }
.bt-role-search input { width: 100%; border: 1px solid var(--bt-border); border-radius: 10px; padding: 9px 12px 9px 38px; font-size: 13px; outline: 0; background: #fff; }
.bt-role-search input:focus { border-color: var(--bt-accent); box-shadow: 0 0 0 3px rgba(251, 111, 141, .15); }
.bt-role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bt-role-card { --rc: #ef2d57; position: relative; background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: transform .18s, box-shadow .18s; overflow: hidden; }
.bt-role-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--rc); }
.bt-role-card:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-lg); }
.bt-role-card[hidden] { display: none; }
.bt-role-top { display: flex; align-items: center; gap: 12px; }
.bt-role-avatar { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13.5px; color: #fff; background: var(--rc); letter-spacing: .02em; box-shadow: 0 6px 14px rgba(9, 36, 56, .14); }
.bt-role-title { min-width: 0; flex: 1; }
.bt-role-title h6 { margin: 0 0 3px; font-weight: 700; color: var(--bt-ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-role-level { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 1px 9px; }
.bt-role-level.high { background: #f3f6f9; color: #bc193c; }
.bt-role-level.mid { background: #eaf1fe; color: #1d4ed8; }
.bt-role-level.low { background: #e8f7ee; color: #15803d; }
.bt-role-level.none { background: #f4f6f8; color: #637485; }
.bt-role-edit { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bt-soft); color: var(--bt-primary); font-size: 18px; transition: background .15s, color .15s; }
.bt-role-edit:hover { background: var(--bt-primary); color: #fff; }
.bt-role-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bt-role-nums > div { background: var(--bt-bg); border-radius: 10px; padding: 8px 10px; }
.bt-role-nums b { display: block; font-size: 20px; color: var(--bt-ink); line-height: 1.1; }
.bt-role-nums span { font-size: 11.5px; color: var(--bt-muted); }
.bt-role-bar-track { height: 5px; border-radius: 4px; background: #f2f4f7; overflow: hidden; margin-top: -4px; }
.bt-role-bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--rc); }
.bt-role-mods { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-role-mods span { font-size: 11.5px; border: 1px solid var(--bt-border); border-radius: 20px; padding: 2px 9px; color: var(--bt-text); background: #fff; }
.bt-role-mods span small { color: var(--bt-muted); font-weight: 600; }
.bt-role-mods span.full { border-color: transparent; background: #e8f7ee; color: #15803d; }
.bt-role-mods span.full small { color: #15803d; }
.bt-role-mods em { font-size: 12px; color: var(--bt-muted); }
.bt-role-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 40px 16px; background: #fff; border: 1px dashed var(--bt-border); border-radius: var(--bt-radius); color: var(--bt-muted); font-size: 13px; }
.bt-role-empty[hidden] { display: none; }
.bt-role-empty i { font-size: 40px; color: var(--bt-accent); }
.bt-role-empty b { color: var(--bt-ink); font-size: 14px; }

/* ===== Settings lists as cards (Occurrence Category, Document Type) ===== */
.bt-mc-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.bt-mc-card .bt-role-avatar { font-size: 21px; }
.bt-mc-card .bt-status-pill { font-size: 11px; padding: 1px 9px; }
.bt-mc-card.is-off { background: #fafbfc; }
.bt-mc-card.is-off .bt-role-avatar { background: #b2bec9; box-shadow: none; }
.bt-mc-card.is-off::before { background: #dadee3; }
.bt-mc-card.is-off h6 { color: var(--bt-muted); }
.bt-mc-use { display: flex; align-items: center; gap: 10px; background: var(--bt-bg); border-radius: 10px; padding: 8px 12px; }
.bt-mc-use > b { font-size: 21px; color: var(--bt-ink); line-height: 1; white-space: nowrap; }
.bt-mc-use > div { display: flex; flex-direction: column; min-width: 0; }
.bt-mc-use span { font-size: 12px; color: var(--bt-text); font-weight: 600; }
.bt-mc-use small { font-size: 11px; color: var(--bt-muted); }
.bt-mc-note { display: flex; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--bt-muted); background: var(--bt-bg); border-radius: 10px; padding: 8px 10px; }
.bt-mc-note i { color: var(--bt-primary); font-size: 16px; }
.bt-mc-bar .bt-role-search { min-width: 180px; max-width: 280px; }
.bt-mc-bar .bt-role-stats > div { padding: 6px 10px; }

/* ===== SOP documents (gallery) ===== */
.bt-sop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.bt-sop-card { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.bt-sop-card:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-lg); }
.bt-sop-card[hidden] { display: none; }
.bt-sop-thumb { position: relative; height: 170px; border: 0; border-bottom: 1px solid var(--bt-border); padding: 0; display: grid; place-items: center; cursor: zoom-in; overflow: hidden;
    background: #fafbfc repeating-conic-gradient(#f4f6f8 0% 25%, transparent 0% 50%) 50% / 16px 16px; color: var(--bt-accent); font-size: 52px; }
.bt-sop-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: transparent; transition: transform .3s; }
.bt-sop-thumb:hover img { transform: scale(1.04); }
.bt-sop-thumb:hover .bt-co-chart-zoom { opacity: 1; transform: translate(-50%, 0); }
.bt-sop-thumb.is-missing { cursor: default; color: #be123c; font-size: 34px; display: flex; flex-direction: column; justify-content: center; gap: 4px; background: #fdecee; }
.bt-sop-thumb.is-missing small { font-size: 12px; }
.bt-sop-type { position: absolute; top: 8px; left: 8px; background: rgba(9, 36, 56, .78); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; border-radius: 6px; padding: 2px 7px; }
.bt-sop-body { padding: 12px 14px 4px; min-width: 0; flex: 1; }
.bt-sop-body h6 { margin: 0 0 3px; font-weight: 700; color: var(--bt-ink); font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bt-sop-body small { color: var(--bt-muted); font-size: 11.5px; }
.bt-sop-actions { display: flex; gap: 6px; padding: 8px 14px 14px; }
.bt-sop-actions a, .bt-sop-actions button { flex: 1; height: 34px; border-radius: 9px; border: 0; background: var(--bt-soft); color: var(--bt-primary); display: grid; place-items: center; font-size: 17px; transition: background .15s, color .15s; }
.bt-sop-actions a:hover, .bt-sop-actions button:hover { background: var(--bt-primary); color: #fff; }
.bt-sop-actions .is-danger { background: #fdecee; color: #be123c; }
.bt-sop-actions .is-danger:hover { background: #be123c; color: #fff; }
.bt-cv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; display: grid; place-items: center; z-index: 2; }
.bt-cv-nav:hover { background: rgba(255, 255, 255, .24); }
.bt-cv-nav.prev { left: 16px; }
.bt-cv-nav.next { right: 16px; }
.bt-cv.single .bt-cv-nav { display: none; }
.bt-cv-title [data-v-count] { margin-left: 6px; }

/* ===== Light sidebar + topbar (brand colours used lightly) ===== */
:root { --bt-sidebar: linear-gradient(180deg, #ffffff 0%, #f7fafc 60%, #f2f6fa 100%); }
.sidebar-wrapper { background: var(--bt-sidebar); border-right: 1px solid var(--bt-border); box-shadow: 2px 0 18px rgba(0, 38, 63, .05) !important; }
.sidebar-header { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--bt-border); }
.sidebar-header .logo-text { height: 38px; }
.sidebar-header .logo-icon { filter: none; }
.sidebar-header .toggle-icon { color: #00466e; background: #eef4f9; }
.sidebar-header .toggle-icon:hover { background: #ffe9ee; color: #e8174b; }

.sidebar-wrapper .bt-menu-label { color: #8a9bb0; }
.sidebar-wrapper .metismenu a { color: #2c4359; font-weight: 500; }
.sidebar-wrapper .metismenu a .parent-icon { color: #5b7690; }
.sidebar-wrapper .metismenu > li > a:hover,
.sidebar-wrapper .metismenu > li > a:focus { color: #062a44; background: #eef4f9; }
.sidebar-wrapper .metismenu > li > a:hover .parent-icon { color: #e8174b; }
.sidebar-wrapper .metismenu > li.mm-active > a {
    color: #c8113f; font-weight: 700;
    background: linear-gradient(90deg, #ffe9ee 0%, #fff5f7 100%);
    box-shadow: inset 3px 0 0 #fd1a4d;
}
.sidebar-wrapper .metismenu > li.mm-active > a .parent-icon { color: #e8174b; }
.sidebar-wrapper .metismenu ul { border-left: 1px solid #e3e9ef; }
.sidebar-wrapper .metismenu ul a { color: #4f667c; }
.sidebar-wrapper .metismenu ul a i { opacity: .5; }
.sidebar-wrapper .metismenu ul a:hover,
.sidebar-wrapper .metismenu ul a:focus { color: #062a44; background: #f1f6fa; }
.sidebar-wrapper .metismenu ul .mm-active > a,
.sidebar-wrapper .metismenu ul a:active { color: #c8113f; background: #fff1f4; font-weight: 600; }
.sidebar-wrapper .metismenu ul .mm-active > a i { color: #e8174b; opacity: 1; }
.sidebar-wrapper .metismenu .has-arrow:after { border-color: #9aaabb; }
.sidebar-wrapper hr { border-color: var(--bt-border); }
.sidebar-wrapper .client-logo { background: #fff; border: 1px solid var(--bt-border); box-shadow: 0 4px 14px rgba(0, 38, 63, .05); }
.sidebar-wrapper .client-logo img { border: 1px solid var(--bt-border); }
.sidebar-wrapper .client-logo .bt-client-label { color: #8a9bb0; }
.sidebar-wrapper .client-logo .bt-client-name { color: #062a44; }
.sidebar-wrapper .metismenu > li.bt-master-link > a { border-color: #f5b8c7; }
.sidebar-wrapper .metismenu > li.bt-master-link > a .parent-icon { color: #e8174b; }

/* topbar: same soft tint, thin brand line on top */
.topbar {
    background: linear-gradient(90deg, rgba(255, 255, 255, .94) 0%, rgba(255, 246, 248, .94) 100%);
    border-bottom: 1px solid var(--bt-border);
    box-shadow: 0 2px 12px rgba(0, 38, 63, .04);
}
.topbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #00466e 0%, #fd1a4d 100%); opacity: .85; }

/* ===== Change password ===== */
.bt-pw-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1100px; }
@media (max-width: 991px) { .bt-pw-wrap { grid-template-columns: 1fr; } }
.bt-pw-profile { padding-bottom: 8px; }
.bt-pw-avatar { width: 104px; height: 104px; margin: -52px auto 0; position: relative; border-radius: 50%; background: #fff; padding: 4px; box-shadow: 0 10px 26px rgba(0, 38, 63, .16); }
.bt-pw-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bt-pw-avatar span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--bt-soft); color: var(--bt-primary); font-size: 32px; font-weight: 800; }
.bt-pw-chips { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bt-pw-chips span { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 3px 11px; font-size: 12px; font-weight: 600; background: #eef4f9; color: #00466e; }
.bt-pw-chips span.is-role { background: var(--bt-soft); color: var(--bt-primary); }
.bt-pw-hint { display: block; color: var(--bt-muted); font-size: 11px; }
.bt-pw-form { padding: 22px 24px; }
.bt-pw-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--bt-border); }
.bt-pw-head h5 { margin: 0 0 3px; font-weight: 800; color: var(--bt-ink); }
.bt-pw-head p { margin: 0; color: var(--bt-muted); font-size: 12.5px; }
.bt-pw-lock { flex: none; width: 46px; height: 46px; border-radius: 13px; background: var(--bt-gradient); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 8px 18px rgba(232, 23, 75, .28); }
.bt-pw-fields { display: grid; gap: 18px; padding: 18px 0 6px; max-width: 520px; }
.bt-pw-input { position: relative; }
.bt-pw-input > i { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); color: var(--bt-muted); font-size: 18px; pointer-events: none; }
.bt-pw-input .form-control { padding-left: 28px; padding-right: 40px; letter-spacing: .04em; }
.bt-pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--bt-muted); font-size: 19px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.bt-pw-eye:hover { background: var(--bt-soft); color: var(--bt-primary); }
.bt-pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.bt-pw-meter i { height: 5px; border-radius: 4px; background: #e8edf2; transition: background .2s; }
.bt-pw-meter.s1 i:nth-child(-n+1) { background: #e11d48; }
.bt-pw-meter.s2 i:nth-child(-n+2) { background: #f59e0b; }
.bt-pw-meter.s3 i:nth-child(-n+3) { background: #0ea5e9; }
.bt-pw-meter.s4 i { background: #16a34a; }
.bt-pw-strength { font-size: 12px; color: var(--bt-muted); margin-top: 5px; font-weight: 600; }
.bt-pw-strength.s1 { color: #be123c; } .bt-pw-strength.s2 { color: #b45309; } .bt-pw-strength.s3 { color: #0369a1; } .bt-pw-strength.s4 { color: #15803d; }
.bt-pw-match { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.bt-pw-match.ok { color: #15803d; } .bt-pw-match.bad { color: #be123c; }
.bt-pw-rules { list-style: none; padding: 12px 14px; margin: 14px 0 0; background: var(--bt-bg); border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; max-width: 520px; }
@media (max-width: 575px) { .bt-pw-rules { grid-template-columns: 1fr; } }
.bt-pw-rules li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--bt-muted); }
.bt-pw-rules li i { font-size: 16px; }
.bt-pw-rules li small { color: var(--bt-primary); font-weight: 600; margin-left: 2px; }
.bt-pw-rules li.is-ok { color: #15803d; }
.bt-pw-rules li.is-ok small { color: #15803d; }
.bt-pw-form .bt-co-actions { max-width: 520px; justify-content: flex-start; flex-direction: row-reverse; }

/* ===== My profile ===== */
.bt-pf-avatar { cursor: pointer; display: block; }
.bt-pf-photo { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.bt-pf-photo img { width: 100%; height: 100%; object-fit: cover; }
.bt-pf-photo b { width: 100%; height: 100%; display: grid; place-items: center; background: var(--bt-soft); color: var(--bt-primary); font-size: 32px; font-weight: 800; }
.bt-pf-cam { position: absolute; right: 2px; bottom: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--bt-gradient); color: #fff; display: grid; place-items: center; font-size: 16px; border: 3px solid #fff; transition: transform .15s; }
.bt-pf-avatar:hover .bt-pf-cam { transform: scale(1.1); }
.bt-pf-links { padding: 4px 18px 10px; }
.bt-pf-links a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bt-bg); color: var(--bt-ink); font-weight: 600; font-size: 13px; }
.bt-pf-links a:hover { background: var(--bt-soft); color: var(--bt-primary); }
.bt-pf-note { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11.5px; color: var(--bt-muted); }
.bt-pf-note.is-warn { color: #b45309; font-weight: 600; }
#profileForm .bt-co-actions { justify-content: flex-end; }
.bt-pf-avatar.bt-pw-avatar > .bt-pf-photo { width: 100%; height: 100%; border-radius: 50%; background: none; display: block; }
.bt-pf-avatar.bt-pw-avatar > .bt-pf-cam { width: 32px; height: 32px; border-radius: 50%; background: var(--bt-gradient); color: #fff; font-size: 16px; display: grid; }
#profileForm .bt-co-actions { flex-direction: row; justify-content: flex-end; max-width: none; }

/* ===== Site map page ===== */
.bt-sm-kpis { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (min-width: 1200px) { .bt-sm-kpis { grid-template-columns: repeat(4, 1fr); } }
.bt-sm-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 330px); min-height: 520px; }
@media (max-width: 991px) { .bt-sm-wrap { grid-template-columns: 1fr; height: auto; } .bt-sm-list { max-height: 360px; } .bt-sm-map { height: 520px; } }
.bt-sm-list { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bt-sm-list-head { padding: 12px; border-bottom: 1px solid var(--bt-border); display: grid; gap: 10px; }
.bt-sm-list-head .bt-role-search { max-width: none; margin: 0; }
.bt-sm-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-sm-filters button { border: 1px solid var(--bt-border); background: #fff; color: var(--bt-text); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.bt-sm-filters button b { color: var(--bt-muted); font-weight: 700; }
.bt-sm-filters button.is-on { background: var(--bt-ink); border-color: var(--bt-ink); color: #fff; }
.bt-sm-filters button.is-on b { color: #cfe0ee; }
.bt-sm-filters button i.bx { color: #b45309; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.patrolled { background: #16a34a; } .dot.guarded { background: #fd1a4d; } .dot.idle { background: #00466e; }
.bt-sm-items { overflow-y: auto; flex: 1; padding: 6px; }
.bt-sm-item { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 8px; transition: background .15s, border-color .15s; }
.bt-sm-item:hover { background: var(--bt-bg); }
.bt-sm-item.is-active { background: var(--bt-soft-2); border-color: #f5b8c7; }
.bt-sm-item[hidden] { display: none; }
.bt-sm-thumb { position: relative; flex: none; width: 50px; height: 50px; border-radius: 11px; overflow: visible; background: #eef4f9; display: grid; place-items: center; }
.bt-sm-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.bt-sm-thumb b { color: #00466e; font-size: 14px; }
.bt-sm-thumb .dot { position: absolute; right: -2px; top: -2px; width: 12px; height: 12px; border: 2px solid #fff; }
.bt-sm-text { min-width: 0; display: flex; flex-direction: column; }
.bt-sm-text > b { color: var(--bt-ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-sm-text > small { color: var(--bt-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-sm-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.bt-sm-tags em { font-style: normal; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 0 7px; }
.bt-sm-tags em.g { background: #ffe9ee; color: #c8113f; } .bt-sm-tags em.t { background: #e8f7ee; color: #15803d; }
.bt-sm-tags em.i { background: #fff4e0; color: #b45309; } .bt-sm-tags em.n { background: #f1f5f9; color: #64748b; }
.bt-sm-none { text-align: center; color: var(--bt-muted); padding: 30px 10px; font-size: 13px; }
.bt-sm-none i { display: block; font-size: 30px; color: var(--bt-accent); }
.bt-sm-map { position: relative; border-radius: var(--bt-radius); overflow: hidden; border: 1px solid var(--bt-border); box-shadow: var(--bt-shadow); background: #eef2f6; min-height: 0; }
#smMap { position: absolute; inset: 0; }
.bt-sm-legend { position: absolute; left: 12px; bottom: 26px; background: rgba(255, 255, 255, .95); border-radius: 10px; padding: 7px 12px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--bt-text); box-shadow: 0 4px 16px rgba(0, 38, 63, .12); }
.bt-sm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bt-sm-legend .pin { width: 11px; height: 11px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: inline-block; }
.bt-sm-legend .pin.patrolled { background: #16a34a; } .bt-sm-legend .pin.guarded { background: #fd1a4d; } .bt-sm-legend .pin.idle { background: #00466e; }
.bt-sm-fit { position: absolute; left: 12px; top: 12px; border: 0; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--bt-ink); display: inline-flex; gap: 6px; align-items: center; box-shadow: 0 4px 16px rgba(0, 38, 63, .12); }
.bt-sm-fit:hover { color: var(--bt-primary); }
/* info card */
.bt-sm-card { width: 290px; font-family: var(--bt-font); }
.bt-sm-card-media { position: relative; height: 130px; margin: -2px -2px 10px; border-radius: 10px; overflow: hidden; background: #eef2f6; }
.bt-sm-card-media img { width: 100%; height: 100%; object-fit: cover; }
.bt-sm-card-chart { position: absolute; right: 8px; bottom: 8px; background: rgba(6, 42, 68, .82); color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 3px 9px; display: inline-flex; gap: 4px; align-items: center; }
.bt-sm-card-chart:hover { color: #fff; background: #e8174b; }
.bt-sm-card-status { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; margin-bottom: 4px; }
.bt-sm-card-status.patrolled { background: #e8f7ee; color: #15803d; } .bt-sm-card-status.guarded { background: #ffe9ee; color: #c8113f; } .bt-sm-card-status.idle { background: #eef4f9; color: #00466e; }
.bt-sm-card h6 { margin: 0 0 6px; font-weight: 800; color: var(--bt-ink); font-size: 15px; }
.bt-sm-card p { margin: 0 0 4px; font-size: 12px; color: var(--bt-muted); display: flex; gap: 6px; align-items: flex-start; }
.bt-sm-card p i { color: var(--bt-primary); font-size: 14px; margin-top: 1px; }
.bt-sm-card-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0; }
.bt-sm-card-nums div { background: var(--bt-bg); border-radius: 8px; padding: 5px 4px; text-align: center; }
.bt-sm-card-nums b { display: block; font-size: 14px; color: var(--bt-ink); }
.bt-sm-card-nums span { font-size: 9.5px; color: var(--bt-muted); line-height: 1.1; display: block; }
.bt-sm-card-nums .bad { background: #fff4e0; } .bt-sm-card-nums .bad b { color: #b45309; }
.bt-sm-card-actions { display: flex; gap: 5px; }
.bt-sm-card-actions a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; font-weight: 600; background: var(--bt-soft); color: var(--bt-primary); border-radius: 8px; padding: 6px 4px; white-space: nowrap; }
.bt-sm-card-actions a:hover { background: var(--bt-primary); color: #fff; }
.gm-style .gm-style-iw-c { border-radius: 14px; padding: 12px !important; box-shadow: 0 14px 40px rgba(0, 38, 63, .22); }
.bt-sm-wrap { height: calc(100vh - 372px); }
.bt-sm-card-media { height: 112px; }
.gm-style .gm-style-iw-d { overflow: hidden !important; }
.gm-style .gm-style-iw-c { max-height: none !important; }

/* ===== QR clocking (route setup) ===== */
.bt-rs-method { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--bt-bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.bt-rs-method b { display: block; color: var(--bt-ink); font-size: 13px; }
.bt-rs-method small { color: var(--bt-muted); font-size: 11.5px; }
.bt-rs-mbadge { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 8px; vertical-align: middle; }
.bt-rs-mbadge.nfc { background: #eef4f9; color: #00466e; }
.bt-rs-mbadge.qr { background: #ffe9ee; color: #c8113f; }
.bt-rs-mbadge.both { background: #e8f7ee; color: #15803d; }
#rsPanel[data-method="qr"] .bt-col-nfc { opacity: .45; }
#rsPanel[data-method="nfc"] .bt-col-qr { opacity: .6; }
.bt-rs-qr { border: 1px solid var(--bt-border); background: #fff; border-radius: 8px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--bt-ink); white-space: nowrap; margin-top: 4px; }
.bt-rs-qr i { font-size: 17px; color: var(--bt-primary); }
.bt-rs-qr:hover { border-color: var(--bt-primary); background: var(--bt-soft-2); }
.bt-rs-addbar { align-items: center; }
/* QR panel */
.bt-qr-loading { padding: 40px; text-align: center; color: var(--bt-muted); }
.bt-qr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.bt-qr-head h5 { margin: 0; font-weight: 800; color: var(--bt-ink); }
.bt-qr-head small { color: var(--bt-muted); }
.bt-qr-note, .bt-qr-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.bt-qr-note { background: #eef4f9; color: #00466e; }
.bt-qr-warn { background: #fff4e0; color: #92400e; }
.bt-qr-note i, .bt-qr-warn i { font-size: 17px; margin-top: 1px; }
.bt-qr-main { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
@media (max-width: 767px) { .bt-qr-main { grid-template-columns: 1fr; } }
.bt-qr-code { background: #fff; border: 1px solid var(--bt-border); border-radius: 14px; padding: 14px; text-align: center; box-shadow: var(--bt-shadow); }
.bt-qr-code svg { width: 100%; height: auto; display: block; }
.bt-qr-ref { margin-top: 8px; font-size: 11.5px; color: var(--bt-muted); display: flex; justify-content: center; gap: 6px; align-items: center; }
.bt-qr-ref b { background: #eef4f9; color: #00466e; border-radius: 6px; padding: 2px 7px; letter-spacing: .05em; }
.bt-qr-meta { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f4f8; font-size: 12.5px; }
.bt-qr-meta span { color: var(--bt-muted); }
.bt-qr-meta b { color: var(--bt-ink); text-align: right; }
.bt-qr-meta b.ok { color: #15803d; display: inline-flex; gap: 4px; align-items: center; }
.bt-qr-actions { display: grid; gap: 8px; margin-top: 14px; }
.bt-qr-regen { margin-top: 14px; }
.bt-qr-history { margin-top: 22px; border-top: 1px solid var(--bt-border); padding-top: 14px; }
.bt-qr-history h6 { font-weight: 700; color: var(--bt-ink); margin-bottom: 10px; }
.bt-qr-history h6 small { color: var(--bt-muted); font-weight: 500; }
.bt-qr-hrow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f4f8; }
.bt-qr-hcode { position: relative; flex: none; width: 64px; height: 64px; opacity: .45; }
.bt-qr-hcode svg { width: 100%; height: 100%; }
.bt-qr-hcode span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg); background: #be123c; color: #fff; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; padding: 1px 4px; border-radius: 3px; opacity: 1; }
.bt-qr-hinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bt-qr-hinfo b { color: var(--bt-ink); font-size: 12.5px; }
.bt-qr-hinfo small { color: var(--bt-muted); font-size: 11.5px; }
.bt-qr-hinfo small.reason { color: #92400e; font-style: italic; }
.bt-qr-hdl { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bt-soft); color: var(--bt-primary); font-size: 17px; }
.bt-qr-hdl:hover { background: var(--bt-primary); color: #fff; }
/* scan method chip on guard tour pages */
.bt-scan-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 7px; margin-left: 4px; }
.bt-scan-chip.nfc { background: #eef4f9; color: #00466e; }
.bt-scan-chip.qr { background: #ffe9ee; color: #c8113f; }

/* ===== Site list rows ===== */
.bt-sl-site { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.bt-sl-thumb { flex: none; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: #eef4f9; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 38, 63, .08); }
.bt-sl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bt-sl-thumb b { color: #00466e; font-size: 15px; }
.bt-sl-name { display: flex; flex-direction: column; min-width: 0; }
.bt-sl-name b { color: var(--bt-ink); font-size: 13.5px; }
.bt-sl-name small { color: var(--bt-muted); font-size: 11.5px; line-height: 1.35; }
.bt-sl-name .bt-sl-mcst { display: inline-block; width: fit-content; margin-top: 3px; background: #eef4f9; color: #00466e; border-radius: 6px; padding: 0 6px; font-weight: 600; font-size: 10.5px; }
.bt-sl-loc { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--bt-text); font-variant-numeric: tabular-nums; line-height: 1.35; }
.bt-sl-loc i { color: var(--bt-primary); font-size: 17px; margin-top: 1px; }
.bt-sl-loc:hover { color: var(--bt-primary); }
.bt-sl-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.bt-sl-tag.warn { background: #fff4e0; color: #b45309; }
.bt-sl-tag.muted { background: #f1f5f9; color: #64748b; }
.bt-sl-tour { display: flex; flex-direction: column; font-size: 12.5px; color: var(--bt-text); white-space: nowrap; }
.bt-sl-tour b { color: var(--bt-ink); font-size: 15px; display: inline; }
.bt-sl-tour span { color: var(--bt-muted); font-size: 11.5px; }
.bt-sl-tour:hover b, .bt-sl-tour:hover { color: var(--bt-primary); }
.bt-sl-guards { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 3px 10px; font-weight: 700; font-size: 12.5px; background: #f1f5f9; color: #64748b; }
.bt-sl-guards.on { background: #ffe9ee; color: #c8113f; }
.bt-sl-nfc { display: inline-flex; align-items: center; gap: 5px; background: #eef4f9; color: #00466e; border-radius: 8px; padding: 3px 9px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.bt-sl-qr { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--bt-border); background: #fff; border-radius: 12px; padding: 5px 10px 5px 5px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.bt-sl-qr:hover { border-color: var(--bt-primary); box-shadow: 0 4px 14px rgba(232, 23, 75, .12); }
.bt-sl-qr-img { flex: none; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #fff; }
.bt-sl-qr-img svg { width: 100%; height: 100%; }
.bt-sl-qr-text { display: flex; flex-direction: column; white-space: nowrap; }
.bt-sl-qr-text b { font-size: 11.5px; color: var(--bt-ink); letter-spacing: .03em; }
.bt-sl-qr-text small { font-size: 10.5px; color: var(--bt-muted); }
.bt-sl-qr.is-none { border-style: dashed; }
.bt-sl-qr.is-none .bt-sl-qr-img { background: repeating-linear-gradient(45deg, #f3f6f9 0 6px, #e9eef3 6px 12px); color: #9aaabb; font-size: 26px; }
.bt-sl-qr.is-none .bt-sl-qr-text b { color: #64748b; }
.bt-sl-qr.is-none .bt-sl-qr-text small { color: var(--bt-primary); font-weight: 600; }
.bt-sl-tour em { font-style: normal; white-space: nowrap; }

/* ===== Left menu: grouped, icon tiles, quick find ===== */
.bt-nav .metismenu { padding-top: 10px; }
.bt-nav .bt-nav-search { position: relative; margin: 0 2px 6px; list-style: none; }
.bt-nav .bt-nav-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #8a9bb0; font-size: 16px; pointer-events: none; }
.bt-nav .bt-nav-search input { width: 100%; border: 1px solid var(--bt-border); background: #fff; border-radius: 10px; padding: 8px 34px 8px 33px; font-size: 12.5px; color: var(--bt-text); outline: 0; transition: border-color .15s, box-shadow .15s; }
.bt-nav .bt-nav-search input:focus { border-color: #f5b8c7; box-shadow: 0 0 0 3px rgba(232, 23, 75, .1); }
.bt-nav .bt-nav-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); background: #eef4f9; color: #6b7d8f; border-radius: 5px; font-size: 10.5px; padding: 1px 6px; box-shadow: none; font-family: inherit; }
.bt-nav .bt-menu-label { padding: 14px 12px 6px; font-size: 10px; letter-spacing: 1.4px; color: #9aaabb; }
.bt-nav .metismenu > li > a { padding: 7px 10px; gap: 0; }
/* icon tile: soft colour, filled when the section is open */
.bt-nav .metismenu > li > a .parent-icon {
    --c: inherit;
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 18px;
    color: var(--c, #00466e);
    background: color-mix(in srgb, var(--c, #00466e) 11%, #fff);
    transition: background .2s, color .2s, transform .2s;
}
.bt-nav .metismenu > li > a > .parent-icon { color: var(--c); }
.bt-nav .metismenu > li > a:hover .parent-icon { transform: scale(1.06); color: var(--c); }
.bt-nav .metismenu > li.mm-active > a .parent-icon { background: var(--c); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.bt-nav .metismenu > li > a .menu-title { margin-left: 11px; }
.bt-nav .metismenu > li.mm-active > a { color: var(--bt-ink); background: #fff; box-shadow: 0 4px 14px rgba(0, 38, 63, .07), inset 3px 0 0 var(--c, #fd1a4d); font-weight: 700; }
.bt-nav .metismenu > li > a:hover,
.bt-nav .metismenu > li > a:focus { background: #fff; color: var(--bt-ink); }
/* sub items with their own icons */
.bt-nav .metismenu ul { margin: 4px 0 8px 27px; padding-left: 12px; border-left: 2px solid #e8eef4; }
.bt-nav .metismenu ul a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; font-size: 12.8px; color: #4f667c; }
.bt-nav .metismenu ul a i { margin: 0; font-size: 16px; opacity: 1; color: #8a9bb0; }
.bt-nav .metismenu ul a:hover i { color: var(--bt-primary); }
.bt-nav .metismenu ul .mm-active > a { color: #c8113f; background: #fff1f4; font-weight: 600; position: relative; }
.bt-nav .metismenu ul .mm-active > a::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: #fd1a4d; }
.bt-nav .metismenu ul .mm-active > a i { color: #e8174b; }
/* quick find: open matching groups */
.bt-nav .metismenu.is-filtering ul.bt-nav-open { display: block !important; height: auto !important; }
.bt-nav .metismenu [hidden] { display: none !important; }
.bt-nav .bt-nav-none { list-style: none; padding: 14px 12px; color: #8a9bb0; font-size: 12.5px; text-align: center; }
/* collapsed menu: tiles only */
@media screen and (min-width: 1025px) {
    .wrapper.toggled:not(.sidebar-hovered) .bt-nav .bt-nav-search,
    .wrapper.toggled:not(.sidebar-hovered) .bt-nav .bt-menu-label { display: none; }
    .wrapper.toggled:not(.sidebar-hovered) .bt-nav .metismenu > li > a { justify-content: center; padding: 6px; }
}
.bt-crumb-note { font-weight: 500; color: var(--bt-muted); text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Client Info: details managed by Bestech */
.bt-co-managed { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; background: #eef4f9; color: #00466e; border-radius: 12px; padding: 10px 14px; font-size: 12.5px; }
.bt-co-managed i { font-size: 20px; margin-top: 1px; }
.bt-co-lock { color: #8a9bb0; font-size: 13px; vertical-align: -1px; margin-left: 2px; }
.bt-co-form .form-control[readonly] { color: #64748b; background: #f8fafc; border-bottom-style: dashed; cursor: not-allowed; }
.bt-co-allow { padding: 7px 0; border-bottom: 1px dashed var(--bt-border); color: var(--bt-muted); font-size: 13px; }
.bt-co-allow b { color: var(--bt-ink); font-size: 16px; }
.bt-co-allow span { font-size: 11.5px; margin-left: 4px; }
/* QR code clocking switched off for the agency */
.bt-rs-wrap.no-qr .bt-col-qr, .bt-rs-wrap.no-qr #rsPrintQr, .bt-rs-wrap.no-qr .bt-rs-method { display: none !important; }
/* Master Console: modules & sub-modules */
.bt-mods { display: grid; gap: 12px; }
.bt-mod { border: 1px solid var(--bt-border); border-radius: 14px; background: #fbfcfe; transition: border-color .15s, background .15s; }
.bt-mod.is-on { background: #fff; border-color: #f5b8c7; box-shadow: 0 4px 14px rgba(0, 38, 63, .05); }
.bt-mod-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0; cursor: pointer; }
.bt-mod-name { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; color: var(--bt-ink); font-size: 14px; }
.bt-mod-name small { width: 100%; font-weight: 500; color: var(--bt-muted); font-size: 11.5px; }
.bt-mod:not(.is-on) .bt-mod-subs { opacity: .45; pointer-events: none; }
.bt-mod-subs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px 62px; }
.bt-sub { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 11px; border-radius: 20px; border: 1px solid var(--bt-border); background: #fff; color: #64748b; font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none; transition: all .15s; }
.bt-sub input { position: absolute; opacity: 0; pointer-events: none; }
.bt-sub i { font-size: 15px; }
.bt-sub.is-on { background: #ffe9ee; border-color: #f5b8c7; color: #c8113f; }
.bt-sub:not(.is-on) span { text-decoration: line-through; }
.bt-sub.is-locked { cursor: default; background: #eef4f9; border-color: #dbe5ee; color: #00466e; }
.bt-sub .bt-sub-lock { font-size: 12px; opacity: .7; }
@media (max-width: 575px) { .bt-mod-subs { padding-left: 14px; } }

/* ===== Master: all Security Agencies overview ===== */
@media (min-width: 1200px) { .bt-mo-kpis { grid-template-columns: repeat(4, 1fr); } }
.bt-mo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.bt-mo-card { background: #fff; border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.bt-mo-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--bt-gradient); }
.bt-mo-card:hover { transform: translateY(-2px); box-shadow: var(--bt-shadow-lg); }
.bt-mo-card.is-off { background: #fbfbfd; }
.bt-mo-card.is-off::before { background: #cbd5e1; }
.bt-mo-card.is-sel { border-color: #f5b8c7; }
.bt-mo-head { display: flex; gap: 12px; align-items: center; }
.bt-mo-logo { flex: none; width: 52px; height: 52px; border-radius: 13px; border: 1px solid var(--bt-border); background: #fff; display: grid; place-items: center; overflow: hidden; }
.bt-mo-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.bt-mo-logo b { color: #00466e; font-size: 16px; }
.bt-mo-title { min-width: 0; }
.bt-mo-title h6 { margin: 0 0 4px; font-weight: 800; color: var(--bt-ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-mo-title small { display: flex; gap: 6px; align-items: center; }
.bt-mo-title .bt-status-pill { font-size: 11px; padding: 1px 9px; }
.bt-mo-current { font-size: 10.5px; font-weight: 700; background: #ffe9ee; color: #c8113f; border-radius: 20px; padding: 1px 8px; }
.bt-mo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bt-mo-stats > div { background: var(--bt-bg); border-radius: 10px; padding: 7px 8px; text-align: center; }
.bt-mo-stats b { display: block; font-size: 17px; color: var(--bt-ink); line-height: 1.1; }
.bt-mo-stats b small { font-size: 11px; color: var(--bt-muted); font-weight: 600; }
.bt-mo-stats span { font-size: 10.5px; color: var(--bt-muted); }
.bt-mo-stats .bad { background: #fdecee; } .bt-mo-stats .bad b { color: #be123c; }
.bt-mo-bar { height: 5px; border-radius: 4px; background: #eef2f6; overflow: hidden; margin-top: -4px; }
.bt-mo-bar i { display: block; height: 100%; background: var(--bt-gradient); border-radius: 4px; }
.bt-mo-bar i.full { background: #b45309; }
.bt-mo-mods { display: flex; flex-wrap: wrap; gap: 5px; }
.bt-mo-mods span { font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px; background: #eef4f9; color: #00466e; }
.bt-mo-mods span.off { background: #fff4e0; color: #b45309; }
.bt-mo-info { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 12px; color: var(--bt-muted); }
.bt-mo-info li { display: flex; gap: 6px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-mo-info i { color: var(--bt-primary); font-size: 15px; }
.bt-mo-info b { color: var(--bt-ink); }
.bt-mo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
/* master viewing an agency */
.bt-nav .bt-nav-agency { list-style: none; margin: 10px 2px 2px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, #062a44, #00466e); color: #fff; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; }
.bt-nav .bt-nav-agency-label { grid-column: 1 / -1; font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #9fc3dc; font-weight: 700; }
.bt-nav .bt-nav-agency b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-nav .bt-nav-agency form { margin: 0; }
.bt-nav .bt-nav-agency button { border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 8px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.bt-nav .bt-nav-agency button:hover { background: #fd1a4d; }
@media screen and (min-width: 1025px) { .wrapper.toggled:not(.sidebar-hovered) .bt-nav .bt-nav-agency { display: none; } }
