:root {
    --app-bg: #f4f6f8;
    --surface: #ffffff;
    --line: #dbe1e7;
    --text: #1f2933;
    --muted: #697586;
    --brand: #176b87;
    --brand-dark: #0f4c5c;
    --accent: #2f855a;
    --warning: #b7791f;
    --danger: #c2410c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--app-bg);
    color: var(--text);
    font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.dashboard[aria-busy="true"] .panel,
.dashboard[aria-busy="true"] .summary-grid {
    cursor: progress;
}

.dashboard.is-updating .panel,
.dashboard.is-updating .summary-grid {
    opacity: .72;
    transition: opacity .15s ease;
}

.is-loading .bi-arrow-clockwise {
    animation: dashboard-spin .75s linear infinite;
}

@keyframes dashboard-spin {
    to {
        transform: rotate(360deg);
    }
}

.dashboard-update-error {
    margin-bottom: 14px;
}

.lazy-image {
    background: #edf1f4;
}

.lazy-image:not([src]) {
    visibility: hidden;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    min-height: 48px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 6px 10px;
    background: #26343d;
    color: #eef4f7;
}

.brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 2px 8px;
}

.brand-mark {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #d7f4e4;
    color: #195b3c;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #b8c7ce;
    font-size: 12px;
}

.sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.sidebar-nav a {
    display: flex;
    flex: 0 0 auto;
    min-height: 34px;
    align-items: center;
    gap: 10px;
    padding: 6px 9px;
    border-radius: 8px;
    color: #d8e2e7;
    font-size: 13px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #edf7f9;
    color: #15313d;
}

.sidebar-nav i {
    width: 18px;
    text-align: center;
}

.sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, .13);
    color: #b8c7ce;
}

.main-area {
    min-width: 0;
    width: 100%;
    flex: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.topbar > div:first-of-type {
    min-width: 0;
    flex: 1;
}

.dashboard-top-filter {
    display: grid;
    grid-template-columns: 106px minmax(260px, 1fr) 38px;
    flex: 0 1 650px;
    gap: 6px;
    min-width: 440px;
}

.dashboard-top-filter .form-select,
.dashboard-top-filter .btn {
    min-height: 34px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 13px;
}

.dashboard-top-filter .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.topbar strong,
.topbar span {
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.alert-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

.dashboard {
    display: grid;
    gap: 16px;
    padding: 22px;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.page-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 750;
}

.page-header p,
.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.page-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.last-updated {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.filter-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.filter-card {
    padding: 14px;
}

.form-label {
    color: #465362;
    font-size: 13px;
    font-weight: 650;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.summary-card {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 146px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.summary-card:hover {
    border-color: #9db4c0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.summary-badge {
    width: 30px;
    height: 5px;
    border-radius: 99px;
}

.summary-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.summary-card strong {
    font-size: 30px;
    line-height: 1.1;
}

.summary-meta,
.summary-today {
    color: var(--muted);
    font-size: 12px;
}

.summary-today {
    color: var(--brand-dark);
    font-weight: 700;
}

.text-bg-purple {
    background-color: #6f42c1 !important;
    color: #fff !important;
}

.panel {
    padding: 16px;
}

.panel-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 760;
}

.process-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.process-item {
    display: grid;
    gap: 7px;
    min-height: 118px;
    padding: 12px;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    background: #fbfcfd;
}

.process-item span {
    min-height: 38px;
    font-size: 13px;
    font-weight: 700;
}

.process-item strong {
    font-size: 22px;
}

.process-item small {
    color: var(--muted);
    font-size: 12px;
}

.progress {
    height: 7px;
    background: #e9eef2;
}

.progress-bar {
    background: var(--brand);
}

.region-map-shell {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    border: 1px solid #ccd6dd;
    border-radius: 8px;
    background:
        radial-gradient(circle at 24% 26%, rgba(23, 107, 135, .08), transparent 24%),
        radial-gradient(circle at 70% 38%, rgba(47, 133, 90, .09), transparent 26%),
        linear-gradient(135deg, #eef5f7 0%, #f7fafb 100%);
}

.region-map-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(38, 52, 61, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(38, 52, 61, .07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .75), rgba(0, 0, 0, .18));
}

.region-bubble-map {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 330px;
    background: transparent;
}

.region-bubble-map .leaflet-pane,
.region-bubble-map .leaflet-top,
.region-bubble-map .leaflet-bottom {
    z-index: 2;
}

.region-bubble-map .leaflet-control-zoom a {
    border-color: #d7e0e7;
    color: #334155;
}

.region-bubble-icon {
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 999px;
    background: rgba(23, 107, 135, .92);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .22);
}

.region-bubble-icon.has-delay {
    background: rgba(194, 65, 12, .92);
}

.region-bubble-icon strong {
    display: block;
    font-size: 14px;
    line-height: 1;
}

.region-bubble-icon span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1;
}

.region-label-icon {
    padding: 3px 8px;
    border: 1px solid rgba(148, 163, 184, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #1f2933;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}

.region-kakao-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: max-content;
}

.region-kakao-bubble {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: rgba(23, 107, 135, .94);
    color: #fff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .28);
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.region-kakao-bubble:hover,
.region-kakao-bubble:focus-visible {
    background: #075a78;
    outline: 3px solid rgba(13, 110, 253, .35);
    outline-offset: 2px;
}

.region-kakao-bubble strong,
.region-kakao-bubble span {
    grid-column: 1;
}

.region-kakao-bubble strong {
    align-self: end;
    font-size: 13px;
    font-weight: 800;
}

.region-kakao-bubble span {
    align-self: start;
    margin-top: 2px;
    font-size: 10px;
}

.region-kakao-bubble-small {
    width: 36px;
    height: 36px;
}

.region-kakao-bubble-small strong {
    font-size: 12px;
}

.region-kakao-bubble-normal {
    width: 54px;
    height: 54px;
}

.region-kakao-bubble-large {
    width: 68px;
    height: 68px;
}

.region-kakao-bubble-xlarge {
    width: 82px;
    height: 82px;
}

.region-kakao-bubble-large strong,
.region-kakao-bubble-xlarge strong {
    font-size: 15px;
}

.region-kakao-label {
    display: block;
    max-width: 112px;
    margin-top: 4px;
    padding: 3px 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 82, 112, .68);
    border-radius: 4px;
    background: rgba(255, 255, 255, .95);
    color: #17212b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .15);
}

.region-kakao-unavailable {
    display: grid;
    min-height: inherit;
    place-items: center;
    color: #52606d;
    font-size: 13px;
    font-weight: 700;
}

.leaflet-container {
    font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.leaflet-popup-content {
    margin: 10px 12px;
    min-width: 150px;
}

.region-popup-title {
    color: #17212b !important;
    font-weight: 800;
    margin-bottom: 6px;
}

.region-popup-grid {
    color: #17212b !important;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    font-size: 12px;
}

.region-popup-grid span {
    color: #5f6b76 !important;
}

.region-popup-grid strong {
    color: #17212b !important;
    font-weight: 700;
}

.admin-users-table code,
.work-inspection-table code {
    padding: 0;
    color: inherit;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
}

.region-map-shell-large,
.region-map-shell-large .region-bubble-map {
    min-height: 520px;
}

.region-map-modal-dialog {
    max-width: calc(100vw - 28px);
    height: calc(100vh - 28px);
    margin-top: 14px;
    margin-bottom: 14px;
}

.region-map-modal-dialog .modal-content {
    height: 100%;
}

.region-map-modal-dialog .modal-body {
    min-height: 0;
    padding: 10px;
}

.region-map-modal-shell,
.region-map-modal-shell .region-bubble-map {
    height: 100%;
    min-height: 0;
}

.region-map-help {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: none;
}

.region-map-help span,
.map-level-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #334155;
    font-size: 12px;
    font-weight: 750;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.map-level-indicator {
    border-radius: 8px;
}

.delay-list,
.status-list,
.activity-list {
    display: grid;
    gap: 9px;
}

.delay-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid #e4e9ef;
    border-radius: 8px;
    background: #fbfcfd;
}

.delay-item small {
    grid-column: 2 / 4;
    color: var(--muted);
}

.delay-title {
    min-width: 0;
    font-weight: 700;
}

.work-inspection-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.work-inspection-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #d8e0e8;
    border-radius: 7px;
    background: #f8fafc;
    color: #52606d;
    font-size: 13px;
    font-weight: 700;
}

.work-inspection-tabs .nav-link.active {
    border-color: var(--brand);
    background: rgba(37, 99, 235, .12);
    color: var(--brand);
}

.work-inspection-sort {
    width: 116px;
}

.list-sort-control {
    width: 126px;
}

.list-page-size-control {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: 108px;
}

.list-page-size-control label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.list-panel-controls,
.list-region-filter,
.work-inspection-region-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

.list-panel-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.list-region-filter .form-select,
.work-inspection-region-filter .form-select {
    width: 112px;
}

.work-inspection-address {
    min-width: 180px;
    max-width: 280px;
}

.compact-definition dt,
.compact-definition dd {
    margin-bottom: 6px;
    font-size: 13px;
}

.compact-definition dt {
    color: var(--muted);
}

.text-prewrap {
    white-space: pre-wrap;
}

.inquiry-message-list {
    display: grid;
    gap: 7px;
    max-height: 240px;
    overflow-y: auto;
}

.inquiry-message-item {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid #e4e9ef;
    border-radius: 7px;
    background: #fbfcfd;
    font-size: 13px;
}

.inquiry-message-item small {
    color: var(--muted);
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.mini-metrics > div,
.status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #e4e9ef;
    border-radius: 8px;
    background: #fbfcfd;
}

.mini-metrics > div {
    display: grid;
}

.mini-metrics span,
.status-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.mini-metrics strong,
.status-list strong {
    font-size: 20px;
}

.activity-list .dashboard-activity-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #edf1f4;
}

.activity-list .dashboard-activity-item:last-child {
    border-bottom: 0;
}

.activity-list time {
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
}

.activity-list strong,
.activity-list small {
    display: block;
}

.activity-list small {
    color: var(--muted);
    margin-top: 2px;
}

.admin-table-wrap {
    min-height: 240px;
}

.admin-row-actions {
    white-space: nowrap;
}

.admin-row-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.admin-users-page .modal .form-text {
    color: var(--muted);
    font-size: 12px;
}

.project-management-page .project-metric {
    display: block;
    font-weight: 750;
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    color: #596678;
    font-size: 12px;
    white-space: nowrap;
}

.table td {
    font-size: 14px;
}

.mobile-nav {
    display: grid;
    gap: 6px;
}

.mobile-nav a {
    padding: 12px;
    border-radius: 8px;
    background: #f5f7f9;
    font-weight: 700;
}

.mobile-nav a.active {
    background: #e6f3f6;
    color: var(--brand-dark);
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(21, 49, 61, .86), rgba(24, 96, 84, .66)),
        url("../images/concept.jpg") center / cover no-repeat,
        #176b87;
}

.login-shell {
    min-height: 100vh;
    width: min(100%, 1440px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 430px);
    align-items: center;
    gap: clamp(30px, 5vw, 78px);
    padding: clamp(28px, 4.4vw, 62px) clamp(24px, 5vw, 70px);
}

.login-visual {
    position: relative;
    display: flex;
    min-height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 0;
    color: #fff;
}

.login-visual > * {
    position: relative;
    z-index: 1;
}

.login-brand {
    color: #fff;
    padding: 0;
}

.login-brand small {
    color: rgba(255, 255, 255, .72);
}

.login-visual h1 {
    max-width: 620px;
    margin: 18px 0 0;
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.08;
}

.login-visual p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 18px;
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 620px;
    margin-top: 18px;
}

.login-stats span {
    min-height: 86px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
}

.login-stats strong {
    display: block;
    margin-bottom: 5px;
    font-size: 26px;
}

.login-panel {
    display: flex;
    min-height: auto;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
}

.login-card {
    width: min(100%, 430px);
    padding: 30px;
    border: 1px solid rgba(219, 225, 231, .9);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
}

.login-title {
    margin-bottom: 22px;
}

.login-title h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 780;
}

.login-title p {
    margin: 6px 0 0;
    color: var(--muted);
}

.login-card .input-group-text,
.login-card .form-control,
.login-card .btn {
    min-height: 42px;
}

.login-card .input-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
}

.login-card .btn[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-help {
    display: grid;
    margin-top: 18px;
    padding: 12px;
    border-radius: 8px;
    background: #f5f7f9;
    color: #526170;
    font-size: 13px;
}

@media (max-width: 1399.98px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .process-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .topbar {
        top: 48px;
    }
}

@media (max-width: 991.98px) {
    .topbar {
        flex-wrap: wrap;
    }

    .dashboard-top-filter {
        grid-template-columns: 100px minmax(0, 1fr) 38px;
        flex: 1 0 100%;
        order: 3;
        min-width: 0;
    }

    .login-shell {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 28px;
        padding: 28px 22px;
    }

    .login-visual {
        min-height: auto;
        padding: 0;
    }

    .login-panel {
        min-height: auto;
        justify-content: stretch;
        padding: 0;
    }

    .login-card {
        width: 100%;
    }

    .dashboard {
        padding: 16px;
    }

    .page-header {
        align-items: start;
        flex-direction: column;
    }

    .process-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-users-table thead {
        display: none;
    }

    .admin-users-table,
    .admin-users-table tbody,
    .admin-users-table tr,
    .admin-users-table td {
        display: block;
        width: 100%;
    }

    .admin-users-table tr {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
        margin-bottom: 10px;
    }

    .admin-users-table td {
        display: flex;
        align-items: start;
        justify-content: space-between;
        gap: 14px;
        border-bottom: 1px solid #edf1f4;
        padding: 8px 0;
        text-align: right !important;
    }

    .admin-users-table td:last-child {
        border-bottom: 0;
    }

    .admin-users-table td::before {
        content: attr(data-label);
        flex: 0 0 86px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 750;
        text-align: left;
    }

    .admin-row-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        white-space: normal;
    }

    .admin-row-actions::before {
        display: none;
    }

    .admin-row-actions .btn {
        justify-content: center;
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    body:not(.login-page) .delivery-page .panel-header,
    body:not(.login-page) .measurement-collection-page .panel-header,
    body:not(.login-page) .work-inspection-page .panel-header {
        flex-wrap: wrap;
    }

    body:not(.login-page) .list-panel-controls {
        width: 100%;
        justify-content: flex-start;
    }

    body:not(.login-page) .list-region-filter,
    body:not(.login-page) .work-inspection-region-filter {
        flex: 1 1 100%;
    }

    body:not(.login-page) .list-region-filter .form-select,
    body:not(.login-page) .work-inspection-region-filter .form-select {
        flex: 1 1 0;
        width: auto;
    }

    .login-stats {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 22px;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar > div:first-of-type span,
    .user-chip,
    .last-updated {
        display: none;
    }

    .dashboard-top-filter {
        grid-template-columns: 86px minmax(0, 1fr) 36px;
        gap: 5px;
    }

    .dashboard {
        padding: 12px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .summary-grid,
    .process-strip,
    .mini-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card {
        min-height: 132px;
        padding: 13px;
    }

    .summary-card strong {
        font-size: 24px;
    }

    .region-map-shell,
    .region-bubble-map {
        min-height: 260px;
    }

    .region-map-shell-large,
    .region-map-shell-large .region-bubble-map {
        min-height: 420px;
    }

    .region-map-help {
        position: static;
        padding: 8px;
        border-top: 1px solid var(--line);
        background: #fff;
    }

    .admin-row-actions {
        grid-template-columns: 1fr;
    }
}

body:not(.login-page) {
    --app-bg: #23282e;
    --surface: #2e343b;
    --surface-2: #343b43;
    --surface-3: #3b444d;
    --line: #46505a;
    --text: #eef2f5;
    --muted: #aab4bf;
    --brand: #2dd4bf;
    --brand-dark: #5eead4;
    --accent: #60a5fa;
    --warning: #f59e0b;
    --danger: #fb7185;
}

body:not(.login-page) .main-area {
    background: var(--app-bg);
    color: var(--text);
}

body:not(.login-page) .topbar {
    border-bottom-color: #3d4650;
    background: rgba(46, 52, 59, .96);
    color: var(--text);
}

body:not(.login-page) .topbar .text-secondary,
body:not(.login-page) .text-secondary {
    color: var(--muted) !important;
}

body:not(.login-page) .dashboard-top-filter .form-select {
    border-color: #51616e;
    background-color: #343f49;
    color: #f2f7f8;
}

body:not(.login-page) .dashboard-top-filter .form-select:focus {
    border-color: #3dd1c2;
    box-shadow: 0 0 0 .16rem rgba(61, 209, 194, .2);
}

body:not(.login-page) .user-chip,
body:not(.login-page) .filter-card,
body:not(.login-page) .panel,
body:not(.login-page) .summary-card {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

body:not(.login-page) .summary-card:hover,
body:not(.login-page) .process-item:hover,
body:not(.login-page) .delay-item:hover,
body:not(.login-page) .mini-metrics > div:hover,
body:not(.login-page) .status-list > div:hover {
    border-color: #5eead4;
    box-shadow: 0 14px 32px rgba(45, 212, 191, .12);
}

body:not(.login-page) .page-header h1,
body:not(.login-page) .panel-header h2,
body:not(.login-page) .summary-card strong,
body:not(.login-page) .process-item strong,
body:not(.login-page) .mini-metrics strong,
body:not(.login-page) .status-list strong,
body:not(.login-page) .delay-title,
body:not(.login-page) .activity-list strong,
body:not(.login-page) .table td strong {
    color: var(--text);
}

body:not(.login-page) .page-header p,
body:not(.login-page) .panel-header p,
body:not(.login-page) .summary-label,
body:not(.login-page) .summary-meta,
body:not(.login-page) .process-item small,
body:not(.login-page) .delay-item small,
body:not(.login-page) .mini-metrics span,
body:not(.login-page) .status-list span,
body:not(.login-page) .activity-list small,
body:not(.login-page) .last-updated {
    color: var(--muted);
}

body:not(.login-page) .summary-today,
body:not(.login-page) .activity-list time,
body:not(.login-page) .breadcrumb a {
    color: var(--brand-dark);
}

body:not(.login-page) .breadcrumb-item.active {
    color: var(--muted);
}

body:not(.login-page) .process-item,
body:not(.login-page) .delay-item,
body:not(.login-page) .mini-metrics > div,
body:not(.login-page) .status-list > div,
body:not(.login-page) .admin-users-table tr {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--text);
}

body:not(.login-page) .progress {
    background: #20262c;
}

body:not(.login-page) .progress-bar {
    background: var(--brand);
}

body:not(.login-page) .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    color: var(--text);
}

body:not(.login-page) .table thead th {
    color: #c5d0db;
}

body:not(.login-page) .table td {
    color: var(--text);
    border-color: var(--line);
}

body:not(.login-page) .form-label {
    color: #d8e1e8;
}

body:not(.login-page) .form-control,
body:not(.login-page) .form-select,
body:not(.login-page) .input-group-text {
    border-color: #53606b;
    background-color: var(--surface-2);
    color: var(--text);
}

body:not(.login-page) .form-control::placeholder {
    color: #83909d;
}

body:not(.login-page) .form-select {
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, #5eead4 50%),
        linear-gradient(135deg, #5eead4 50%, transparent 50%),
        linear-gradient(to right, rgba(94, 234, 212, .22), rgba(94, 234, 212, .22));
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%,
        calc(100% - 32px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 18px;
    background-repeat: no-repeat;
}

body:not(.login-page) .form-control:focus,
body:not(.login-page) .form-select:focus {
    border-color: var(--brand);
    background-color: #37414a;
    color: var(--text);
    box-shadow: 0 0 0 .2rem rgba(45, 212, 191, .18);
}

body:not(.login-page) .form-select option {
    background: var(--surface-2);
    color: var(--text);
}

body:not(.login-page) .btn-primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #082f2c;
    font-weight: 750;
}

body:not(.login-page) .btn-primary:hover,
body:not(.login-page) .btn-primary:focus {
    border-color: #14b8a6;
    background: #14b8a6;
    color: #062724;
}

body:not(.login-page) .btn-outline-primary {
    border-color: var(--brand);
    color: var(--brand-dark);
}

body:not(.login-page) .btn-outline-primary:hover,
body:not(.login-page) .btn-outline-primary:focus {
    border-color: var(--brand);
    background: rgba(45, 212, 191, .16);
    color: #ccfbf1;
}

body:not(.login-page) .btn-outline-secondary {
    border-color: #607080;
    color: #d2dbe3;
}

body:not(.login-page) .btn-outline-secondary:hover,
body:not(.login-page) .btn-outline-secondary:focus {
    border-color: #8a9aaa;
    background: #3b444d;
    color: var(--text);
}

body:not(.login-page) .btn-outline-danger {
    border-color: var(--danger);
    color: #fecdd3;
}

body:not(.login-page) .btn-outline-danger:hover,
body:not(.login-page) .btn-outline-danger:focus {
    background: rgba(251, 113, 133, .15);
    color: #fff1f2;
}

body:not(.login-page) .btn-outline-dark {
    border-color: #7b8794;
    color: #d8e1e8;
}

body:not(.login-page) .btn-outline-dark:hover,
body:not(.login-page) .btn-outline-dark:focus {
    background: #1f242a;
    color: var(--text);
}

body:not(.login-page) .badge.text-bg-light,
body:not(.login-page) .text-bg-light {
    background-color: #3b444d !important;
    color: #d8e1e8 !important;
    border-color: var(--line) !important;
}

body:not(.login-page) .text-bg-info {
    background-color: #60a5fa !important;
    color: #0b1730 !important;
}

body:not(.login-page) .text-bg-success {
    background-color: #22c55e !important;
    color: #052e16 !important;
}

body:not(.login-page) .text-bg-warning {
    background-color: #f59e0b !important;
    color: #332000 !important;
}

body:not(.login-page) .text-bg-danger {
    background-color: #fb7185 !important;
    color: #3f0713 !important;
}

body:not(.login-page) .text-bg-dark {
    background-color: #111827 !important;
    color: #e5e7eb !important;
}

body:not(.login-page) .text-bg-purple {
    background-color: #a78bfa !important;
    color: #1e1b4b !important;
}

body:not(.login-page) .text-danger {
    color: var(--danger) !important;
}

body:not(.login-page) .alert-danger,
body:not(.login-page) .alert-warning {
    border-color: rgba(251, 113, 133, .38);
    background: rgba(251, 113, 133, .12);
    color: #fecdd3;
}

body:not(.login-page) .alert-warning {
    border-color: rgba(245, 158, 11, .38);
    background: rgba(245, 158, 11, .12);
    color: #fde68a;
}

body:not(.login-page) .dropdown-menu,
body:not(.login-page) .modal-content,
body:not(.login-page) .offcanvas {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

body:not(.login-page) .dropdown-item {
    color: var(--text);
}

body:not(.login-page) .dropdown-item:hover,
body:not(.login-page) .dropdown-item:focus {
    background: var(--surface-2);
    color: var(--brand-dark);
}

body:not(.login-page) .modal-header,
body:not(.login-page) .modal-footer,
body:not(.login-page) .offcanvas-header {
    border-color: var(--line);
}

/* Keep every modal usable within a tablet or mobile viewport. */
body:not(.login-page) .modal-dialog {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    margin-top: 8px;
    margin-bottom: 8px;
}

body:not(.login-page) .modal-dialog .modal-content {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow: hidden;
}

body:not(.login-page) .modal-dialog .modal-body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Forms wrap the header, body and footer in most management modals. */
body:not(.login-page) .modal-dialog .modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

body:not(.login-page) .modal-dialog .modal-content > form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body:not(.login-page) .modal-dialog .modal-content > form .modal-footer {
    flex: 0 0 auto;
}

@supports selector(.modal-content:has(> form)) {
    @media (max-height: 900px) {
        body:not(.login-page) .modal-dialog .modal-content:has(> form) {
            height: calc(100vh - 16px);
            height: calc(100dvh - 16px);
        }
    }
}

@media (max-height: 900px) {
    body:not(.login-page) #detectorMatchModal .modal-content {
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
    }
}

body:not(.login-page) .btn-close {
    filter: invert(1) grayscale(100%);
}

body:not(.login-page) .mobile-nav a {
    background: var(--surface-2);
    color: var(--text);
}

body:not(.login-page) .mobile-nav a.active {
    background: rgba(45, 212, 191, .16);
    color: var(--brand-dark);
}

body:not(.login-page) .region-map-shell {
    border-color: var(--line);
    background:
        radial-gradient(circle at 24% 26%, rgba(45, 212, 191, .12), transparent 24%),
        radial-gradient(circle at 70% 38%, rgba(96, 165, 250, .10), transparent 26%),
        linear-gradient(135deg, #2b3239 0%, #252b31 100%);
}

body:not(.login-page) .region-map-shell::before {
    background-image:
        linear-gradient(rgba(238, 242, 245, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(238, 242, 245, .05) 1px, transparent 1px);
}

body:not(.login-page) .region-map-help span,
body:not(.login-page) .map-level-indicator {
    border-color: var(--line);
    background: rgba(46, 52, 59, .92);
    color: var(--text);
}

body:not(.login-page) .leaflet-popup-content-wrapper,
body:not(.login-page) .leaflet-popup-tip {
    background: var(--surface);
    color: var(--text);
}

body:not(.login-page) .leaflet-control-zoom a {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

body:not(.login-page) .toast {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

@media (max-width: 991.98px) {
    body:not(.login-page) .admin-users-table tr {
        border-color: var(--line);
        background: var(--surface-2);
    }

    body:not(.login-page) .admin-users-table td {
        border-bottom-color: var(--line);
    }
}

body:not(.login-page) .delivery-survey-dialog {
    height: calc(100vh - 24px);
    margin-top: 12px;
    margin-bottom: 12px;
}

body:not(.login-page) .delivery-survey-dialog .modal-content {
    height: 100%;
}

body:not(.login-page) .delivery-survey-dialog .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

body:not(.login-page) #deliverySurveyFrame {
    display: block;
    height: 100%;
    min-height: 0;
}

@media (max-width: 991.98px) {
    body:not(.login-page) .delivery-survey-dialog {
        height: 100%;
        margin: 0;
    }
}

body:not(.login-page) .rdms-image-modal .modal-dialog {
    max-width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    margin-top: 12px;
    margin-bottom: 12px;
}

body:not(.login-page) .rdms-image-modal .modal-content {
    height: 100%;
}

body:not(.login-page) .rdms-image-modal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 10px;
    overflow: auto;
    background: #0f172a;
}

body:not(.login-page) .rdms-image-modal .modal-body.rdms-original-mode {
    align-items: flex-start;
    justify-content: flex-start;
}

body:not(.login-page) .rdms-common-image {
    display: block;
    user-select: none;
}

body:not(.login-page) .rdms-common-image.rdms-fit {
    max-width: 100%;
    max-height: calc(100vh - 92px);
    width: auto;
    height: auto;
    cursor: zoom-in;
}

body:not(.login-page) .rdms-common-image.rdms-original {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

@media (max-width: 575.98px) {
    body:not(.login-page) .region-map-help {
        border-top-color: var(--line);
        background: var(--surface);
    }
}

body:not(.login-page) .sidebar {
    gap: 6px;
    padding: 6px 10px;
}

body:not(.login-page) .brand {
    min-height: 36px;
    padding: 0 7px 2px;
}

body:not(.login-page) .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 13px;
}

body:not(.login-page) .brand small {
    font-size: 11px;
}

body:not(.login-page) .sidebar-nav {
    display: flex;
    gap: 2px;
}

body:not(.login-page) .sidebar-nav a {
    min-height: 32px;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 13px;
}

body:not(.login-page) .sidebar-foot {
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
}

body:not(.login-page) .sidebar-foot small {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.login-page) .topbar {
    min-height: 52px;
    padding: 7px 16px;
}

body:not(.login-page) .icon-btn {
    width: 34px;
    height: 34px;
}

body:not(.login-page) .user-chip {
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
}

body:not(.login-page) .dashboard {
    gap: 10px;
    padding: 14px;
}

body:not(.login-page) .page-header {
    align-items: center;
    gap: 10px;
}

body:not(.login-page) .page-header h1 {
    font-size: 20px;
    line-height: 1.2;
}

body:not(.login-page) .page-header p,
body:not(.login-page) .panel-header p {
    margin-top: 2px;
    font-size: 12px;
}

body:not(.login-page) .breadcrumb {
    margin-bottom: 2px !important;
    font-size: 12px;
}

body:not(.login-page) .page-tools {
    gap: 6px;
}

body:not(.login-page) .last-updated {
    font-size: 12px;
}

body:not(.login-page) .filter-card {
    padding: 8px 10px;
}

body:not(.login-page) .filter-card .row {
    --bs-gutter-x: .45rem;
    --bs-gutter-y: .35rem;
}

body:not(.login-page) .filter-card .form-label {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.15;
}

body:not(.login-page) .filter-card .form-control,
body:not(.login-page) .filter-card .form-select,
body:not(.login-page) .filter-card .btn {
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 13px;
}

body:not(.login-page) .filter-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body:not(.login-page) .compact-mobile-filter .filter-detail-toggle {
    gap: 6px;
}

@media (min-width: 768px) {
    body:not(.login-page) .compact-mobile-filter .advanced-filter.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
    }

    body:not(.login-page) .compact-mobile-filter .filter-actions.collapse {
        display: flex !important;
    }
}

@media (max-width: 767.98px) {
    body:not(.login-page) .compact-mobile-filter {
        padding: 6px;
    }

    body:not(.login-page) .compact-mobile-filter .filter-keyword .form-label {
        display: none;
    }

    body:not(.login-page) .compact-mobile-filter .filter-keyword .form-control,
    body:not(.login-page) .compact-mobile-filter .filter-mobile-submit .btn {
        min-height: 34px;
    }

    body:not(.login-page) .compact-mobile-filter .filter-detail-toggle {
        min-height: 28px;
        padding-top: 2px;
        padding-bottom: 2px;
        font-size: 12px;
    }

    body:not(.login-page) .compact-mobile-filter .advanced-filter.show {
        margin-top: 2px;
    }
}

body:not(.login-page) .panel {
    padding: 10px;
}

body:not(.login-page) .panel-header {
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

body:not(.login-page) .panel-header h2 {
    font-size: 15px;
}

body:not(.login-page) .summary-grid {
    gap: 8px;
}

body:not(.login-page) .summary-card {
    min-height: 84px;
    gap: 3px;
    padding: 11px;
}

body:not(.login-page) .summary-badge {
    width: 24px;
    height: 4px;
}

body:not(.login-page) .summary-label {
    font-size: 12px;
}

body:not(.login-page) .summary-card strong {
    font-size: 24px;
}

body:not(.login-page) .summary-meta,
body:not(.login-page) .summary-today {
    font-size: 11px;
}

body:not(.login-page) .process-strip {
    gap: 7px;
}

body:not(.login-page) .process-item {
    min-height: 88px;
    gap: 4px;
    padding: 9px;
}

body:not(.login-page) .process-item span {
    min-height: 28px;
    font-size: 12px;
}

body:not(.login-page) .process-item strong {
    font-size: 19px;
}

body:not(.login-page) .process-item small,
body:not(.login-page) .table thead th {
    font-size: 11px;
}

body:not(.login-page) .table td {
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 13px;
}

body:not(.login-page) .delay-list,
body:not(.login-page) .status-list,
body:not(.login-page) .activity-list {
    gap: 6px;
}

body:not(.login-page) .work-inspection-tabs .nav-link {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--text);
}

body:not(.login-page) .work-inspection-tabs .nav-link.active {
    border-color: var(--brand);
    background: rgba(45, 212, 191, .14);
    color: var(--brand-dark);
}

body:not(.login-page) .inquiry-message-item {
    border-color: var(--line);
    background: var(--surface-2);
}

body:not(.login-page) .delay-item,
body:not(.login-page) .mini-metrics > div,
body:not(.login-page) .status-list > div {
    min-height: 38px;
    padding: 7px 9px;
}

body:not(.login-page) .mini-metrics {
    gap: 6px;
}

body:not(.login-page) .mini-metrics strong,
body:not(.login-page) .status-list strong {
    font-size: 17px;
}

body:not(.login-page) .activity-list .dashboard-activity-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
}

body:not(.login-page) .admin-table-wrap {
    min-height: 180px;
}

body:not(.login-page) .admin-row-actions .btn {
    gap: 3px;
    margin-left: 3px;
    padding: 3px 7px;
    font-size: 12px;
}

body:not(.login-page) .region-map-shell-large,
body:not(.login-page) .region-map-shell-large .region-bubble-map {
    min-height: 440px;
}

body:not(.login-page) .project-management-page .project-table {
    border-collapse: separate;
    border-spacing: 0 6px;
}

body:not(.login-page) .project-management-page .project-table tbody tr {
    background: var(--surface-2);
}

body:not(.login-page) .project-management-page .project-table tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
}

body:not(.login-page) .project-management-page .project-table tbody td:first-child {
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

body:not(.login-page) .project-management-page .project-table tbody td:last-child {
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

body:not(.login-page) .target-customers-page .customer-table {
    border-collapse: separate;
    border-spacing: 0 5px;
}

body:not(.login-page) .target-customers-page .customer-table tbody tr {
    background: #4a525b;
}

body:not(.login-page) .target-customers-page .customer-table tbody tr.customer-row {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

body:not(.login-page) .target-customers-page .customer-table tbody tr.customer-row:hover,
body:not(.login-page) .target-customers-page .customer-table tbody tr.customer-row:focus {
    background: #535d67;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.22);
    outline: none;
}

body:not(.login-page) .target-customers-page .customer-table tbody td {
    padding-top: 9px;
    padding-bottom: 9px;
}

body:not(.login-page) .target-customers-page .customer-table tbody td:first-child {
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

body:not(.login-page) .target-customers-page .customer-table tbody td:last-child {
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

body:not(.login-page) .target-region-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

body:not(.login-page) .target-region-filter-label {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

body:not(.login-page) .target-region-filter-row .form-select {
    width: auto;
    min-width: 150px;
    max-width: 220px;
}

body:not(.login-page) .detector-inventory-page .detector-table {
    border-collapse: separate;
    border-spacing: 0 5px;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody tr {
    background: #4a525b;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody tr.detector-row {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody tr.detector-row:hover,
body:not(.login-page) .detector-inventory-page .detector-table tbody tr.detector-row:focus {
    background: #535d67;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.22);
    outline: none;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody td {
    padding-top: 9px;
    padding-bottom: 9px;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody td:first-child {
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

body:not(.login-page) .detector-inventory-page .detector-table tbody td:last-child {
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

body:not(.login-page) .detector-detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body:not(.login-page) .detector-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body:not(.login-page) .detector-detail-item {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    padding: 9px 10px;
}

body:not(.login-page) .detector-detail-item span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 12px;
}

body:not(.login-page) .detector-detail-item strong {
    display: block;
    min-height: 20px;
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

body:not(.login-page) .detector-match-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body:not(.login-page) .detector-match-item {
    position: relative;
}

body:not(.login-page) .detector-suggestion-list {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #2f363e;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

body:not(.login-page) .detector-suggestion,
body:not(.login-page) .detector-suggestion-empty {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    background: transparent;
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
}

body:not(.login-page) .detector-suggestion:hover,
body:not(.login-page) .detector-suggestion:focus {
    background: rgba(56, 189, 248, 0.14);
}

body:not(.login-page) .detector-suggestion strong,
body:not(.login-page) .detector-suggestion span {
    display: block;
}

body:not(.login-page) .detector-suggestion span,
body:not(.login-page) .detector-suggestion-empty {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 575.98px) {
    body:not(.login-page) .target-region-filter-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 5px;
    }

    body:not(.login-page) .target-region-filter-row .form-select {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    body:not(.login-page) .target-region-filter-row .form-select:last-child {
        grid-column: 2;
    }

    body:not(.login-page) .detector-detail-grid {
        grid-template-columns: 1fr;
    }

    body:not(.login-page) .detector-match-grid {
        grid-template-columns: 1fr;
    }
}

body:not(.login-page) .customer-inline-control {
    min-width: 112px;
}

body:not(.login-page) .inline-participation-select {
    min-width: 94px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 12px;
}

body:not(.login-page) .stage-badge {
    min-width: 74px;
    padding: 5px 7px;
    border: 1px solid transparent;
    color: #fff;
}

body:not(.login-page) .stage-badge-target {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(37, 99, 235, 0.88);
}

body:not(.login-page) .stage-badge-consent {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(22, 163, 74, 0.9);
}

body:not(.login-page) .stage-badge-assign {
    border-color: rgba(20, 184, 166, 0.45);
    background: rgba(15, 118, 110, 0.9);
}

body:not(.login-page) .stage-badge-install_schedule {
    border-color: rgba(45, 212, 191, 0.45);
    background: rgba(13, 148, 136, 0.88);
}

body:not(.login-page) .stage-badge-installed {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(2, 132, 199, 0.9);
}

body:not(.login-page) .stage-badge-measuring {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(217, 119, 6, 0.9);
}

body:not(.login-page) .stage-badge-collection_schedule {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(126, 34, 206, 0.88);
}

body:not(.login-page) .stage-badge-collected {
    border-color: rgba(217, 70, 239, 0.45);
    background: rgba(162, 28, 175, 0.88);
}

body:not(.login-page) .stage-badge-shipped {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(2, 132, 199, 0.9);
}

body:not(.login-page) .stage-badge-analyzing {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(79, 70, 229, 0.9);
}

body:not(.login-page) .stage-badge-approval {
    border-color: rgba(251, 113, 133, 0.45);
    background: rgba(225, 29, 72, 0.9);
}

body:not(.login-page) .stage-badge-report {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(71, 85, 105, 0.94);
}

body:not(.login-page) .table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 12px;
}

body:not(.login-page) .pagination-summary {
    color: var(--muted);
    font-size: 12px;
}

body:not(.login-page) .table-pagination .page-link {
    min-width: 38px;
    min-height: 38px;
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    line-height: 1.35;
}

body:not(.login-page) .table-pagination .page-item.active .page-link {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(56, 189, 248, 0.18);
    color: var(--text);
}

body:not(.login-page) .table-pagination .page-item.disabled .page-link {
    opacity: 0.45;
}

@media (max-width: 575.98px) {
    body:not(.login-page) .table-pagination {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    body:not(.login-page) .table-pagination .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    body:not(.login-page) .table-pagination .page-link {
        min-width: 42px;
        min-height: 42px;
        padding: 9px 11px;
    }
}

body:not(.login-page) .upload-hint {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
}

body:not(.login-page) .upload-template-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 7px;
    background: rgba(14, 165, 233, 0.08);
}

body:not(.login-page) .upload-template-box strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
}

body:not(.login-page) .upload-template-box span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

body:not(.login-page) .upload-template-box .btn {
    flex: 0 0 auto;
}

body:not(.login-page) .menu-permission-grid,
body:not(.login-page) .role-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body:not(.login-page) .menu-permission-item,
body:not(.login-page) .role-permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
}

body:not(.login-page) .menu-permission-item span,
body:not(.login-page) .role-permission-item span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body:not(.login-page) .delivery-customer-summary {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
}

body:not(.login-page) .delivery-customer-summary strong {
    color: var(--text);
    font-size: 15px;
}

body:not(.login-page) .delivery-customer-summary span,
body:not(.login-page) .delivery-customer-summary small {
    color: var(--muted);
    font-size: 12px;
}

/* Delivery and collection forms wrap the modal sections, so keep the form itself scroll-safe. */
body:not(.login-page) #deliveryModal .modal-content,
body:not(.login-page) #collectionModal .modal-content {
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
}

body:not(.login-page) #deliveryModal form,
body:not(.login-page) #collectionModal form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

body:not(.login-page) #deliveryModal .modal-body,
body:not(.login-page) #collectionModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body:not(.login-page) #deliveryModal .modal-footer,
body:not(.login-page) #collectionModal .modal-footer {
    flex: 0 0 auto;
}

body:not(.login-page) .assigned-detector-summary {
    padding: 10px 12px;
    border: 1px solid #3d728a;
    border-radius: 7px;
    background: #20313b;
}

body:not(.login-page) .assigned-detector-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #d9edf6;
    font-size: 13px;
    font-weight: 700;
}

body:not(.login-page) .assigned-detector-summary-head span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body:not(.login-page) .assigned-detector-summary-head i {
    color: #55d8ff;
}

body:not(.login-page) .assigned-detector-summary-head strong {
    color: #55d8ff;
    font-size: 14px;
}

body:not(.login-page) .assigned-detector-serials {
    margin-top: 7px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

body:not(.login-page) .barcode-scan-button {
    min-width: 42px;
}

body:not(.login-page) .barcode-scan-label {
    margin-left: 4px;
    white-space: nowrap;
    font-size: 12px;
}

body:not(.login-page) .rdms-barcode-modal .modal-dialog {
    max-width: 560px;
}

body:not(.login-page) .rdms-barcode-camera {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #10191f;
}

body:not(.login-page) .rdms-barcode-camera::after {
    position: absolute;
    top: 50%;
    right: 10%;
    left: 10%;
    height: 2px;
    background: #2fd3c5;
    box-shadow: 0 0 8px #2fd3c5;
    content: '';
}

body:not(.login-page) .rdms-barcode-camera video {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 58vh;
    object-fit: cover;
}

body:not(.login-page) .delivery-table .table-contact-email,
body:not(.login-page) .collection-table .table-contact-email {
    display: -webkit-box;
    max-width: 190px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body:not(.login-page) .delivery-table .table-address-two-line,
body:not(.login-page) .collection-table .table-address-two-line {
    display: -webkit-box;
    min-width: 160px;
    max-width: 230px;
    overflow: hidden;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body:not(.login-page) .collection-photo-preview {
    min-height: 31px;
}

body:not(.login-page) .collection-photo-preview .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 575.98px) {
    body:not(.login-page) .menu-permission-grid,
    body:not(.login-page) .role-permission-grid {
        grid-template-columns: 1fr;
    }

    body:not(.login-page) .delivery-table .table-contact-email,
    body:not(.login-page) .collection-table .table-contact-email,
    body:not(.login-page) .delivery-table .table-address-two-line,
    body:not(.login-page) .collection-table .table-address-two-line {
        max-width: none;
    }

    body:not(.login-page) .rdms-barcode-modal .modal-dialog {
        max-width: calc(100vw - 20px);
    }

    body:not(.login-page) .rdms-barcode-camera,
    body:not(.login-page) .rdms-barcode-camera video {
        min-height: 260px;
    }
}

@media (max-width: 575.98px) {
    body:not(.login-page) .upload-template-box {
        align-items: stretch;
        flex-direction: column;
    }

    body:not(.login-page) .upload-template-box .btn {
        width: 100%;
    }
}

body:not(.login-page) .region-map-help {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 5px;
}

body:not(.login-page) .region-map-help span,
body:not(.login-page) .map-level-indicator {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 11px;
}

@media (max-width: 991.98px) {
    body:not(.login-page) .dashboard {
        padding: 10px;
    }

    body:not(.login-page) .page-header {
        align-items: flex-start;
    }

    body:not(.login-page) .admin-users-table tr {
        padding: 9px;
        margin-bottom: 8px;
    }

    body:not(.login-page) .admin-users-table td {
        padding: 6px 0;
    }
}

@media (max-width: 575.98px) {
    body:not(.login-page) .dashboard {
        padding: 8px;
    }

    body:not(.login-page) .page-header h1 {
        font-size: 18px;
    }

    body:not(.login-page) .filter-card {
        padding: 8px;
    }

    body:not(.login-page) .summary-card {
        min-height: 82px;
        padding: 10px;
    }

    body:not(.login-page) .region-map-shell-large,
    body:not(.login-page) .region-map-shell-large .region-bubble-map {
        min-height: 360px;
    }
}
