:root {
    --sos-cyan: #00a6c7;
    --sos-magenta: #d60063;
    --sos-yellow: #f5c514;
    --sos-charcoal: #24282d;
    --page: #f3f5f7;
    --panel: #ffffff;
    --line: #d8e0eb;
    --ink: #24282d;
    --muted: #667085;
    --brand: var(--sos-cyan);
    --brand-soft: #e4f6fa;
}

body {
    background: var(--page);
    color: var(--ink);
}

.navbar-brand {
    color: var(--brand);
}

.panel,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    padding: 1rem;
}

.stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, 1fr);
}

.stats div,
.stat-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem;
}

.stats span,
.stat-card span {
    color: var(--muted);
    display: block;
    font-weight: 600;
}

.stats strong,
.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.stat-card.ok {
    border-color: #86efac;
}

.stat-card.danger {
    border-color: #fca5a5;
}

.section-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.person-row {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 0.55rem 0;
}

.person-row span,
.person-row small,
.empty-small {
    color: var(--muted);
}

.person-row-dashboard {
    align-items: flex-start;
}

.location-header,
.panel-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.location-app-page {
    background: #eef1f3;
}

.location-app-shell {
    margin: 0 auto;
    max-width: 1180px;
}

.location-app-header {
    align-items: center;
    background: #ffffff;
    border-top: 5px solid var(--sos-cyan);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(36, 40, 45, 0.1);
    color: var(--sos-charcoal);
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
}

.location-title-block {
    min-width: 0;
    width: 100%;
}

.location-title-block h1 {
    font-size: 1.75rem;
    line-height: 1.05;
    margin: 0.15rem 0;
}

.location-title-block span,
.location-kicker,
.location-brand {
    color: #5f6970;
    display: block;
}

.location-kicker,
.location-brand {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.location-brand {
    color: var(--sos-charcoal);
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
}

.location-tabs {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    gap: 0.35rem;
    padding: 0.4rem;
}

.location-tabs .nav-item {
    flex: 1 1 0;
}

.location-tabs .nav-link {
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 700;
    min-height: 48px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    width: 100%;
}

.location-tabs .nav-link.active {
    background: var(--brand-soft);
    color: var(--brand);
}

.mobile-top-tabs {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 0.35rem;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0.75rem;
    padding: 0.35rem;
    position: sticky;
    top: 0.5rem;
    z-index: 1020;
}

.mobile-top-tabs button {
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    min-height: 54px;
}

.mobile-top-tabs button.active {
    background: var(--sos-charcoal);
    color: #ffffff;
}

.mobile-top-tabs button[data-bs-target="#visitorsPane"].active {
    background: var(--sos-magenta);
}

.location-app-page .btn-primary {
    --bs-btn-bg: var(--sos-cyan);
    --bs-btn-border-color: var(--sos-cyan);
    --bs-btn-hover-bg: #008da9;
    --bs-btn-hover-border-color: #008da9;
    --bs-btn-active-bg: #007f99;
    --bs-btn-active-border-color: #007f99;
}

.location-app-page .btn-outline-primary {
    --bs-btn-color: #008da9;
    --bs-btn-border-color: var(--sos-cyan);
    --bs-btn-hover-bg: var(--sos-cyan);
    --bs-btn-hover-border-color: var(--sos-cyan);
}

.mobile-actions {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, 1fr);
}

.quick-action {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #008da9;
    font-weight: 700;
    padding: 0.85rem;
    text-align: center;
    text-decoration: none;
}

.admin-card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-nav-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 1rem;
    text-decoration: none;
}

.admin-nav-card:hover {
    border-color: #8bb6d6;
    color: var(--ink);
    transform: translateY(-1px);
}

.admin-nav-card span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-nav-card strong {
    color: var(--brand);
    display: block;
    font-size: 1.7rem;
    line-height: 1.1;
    margin: 0.45rem 0;
}

.admin-nav-card small {
    color: var(--muted);
    line-height: 1.35;
}

.stack-form {
    display: grid;
    gap: 0.75rem;
}

.visitor-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-panel {
    scroll-margin-top: 5rem;
}

.staff-kiosk-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-actions {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

.qr-mobile-actions {
    display: grid;
    gap: 0.55rem;
}

.trouble-link {
    background: transparent;
    border: 0;
    color: var(--muted);
    display: block;
    font-size: 0.9rem;
    margin: 0.65rem auto 0;
    padding: 0.25rem;
    text-decoration: underline;
}

.staff-current-status {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.85rem;
}

.staff-current-status span {
    color: var(--muted);
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.staff-current-status strong {
    display: block;
    font-size: 1.05rem;
}

.inside-list {
    display: grid;
    gap: 0.75rem;
}

.compact-list {
    max-height: calc(100vh - 17rem);
    overflow: auto;
    padding-right: 0.15rem;
}

.inside-card {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem;
}

.activity-feed {
    display: grid;
    gap: 0.75rem;
    max-height: calc(100vh - 17rem);
    overflow: auto;
}

.activity-feed-item {
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem;
}

.form-shell {
    margin: 0 auto;
    max-width: 720px;
}

.qr-box {
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.staff-qr-area,
.face-modal-area,
.live-enrollment-modal {
    align-items: stretch;
    background: rgba(7, 18, 33, 0.94);
    display: none;
    inset: 0;
    justify-content: center;
    overflow: hidden;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    position: fixed;
    z-index: 2000;
}

body.location-app-page.qr-mode,
body.location-app-page.face-mode {
    overflow: hidden;
}

body.location-app-page.qr-mode .staff-qr-area,
body.location-app-page.face-mode .face-modal-area {
    display: flex !important;
}

body.live-enroll-mode .live-enrollment-modal {
    display: flex !important;
}

.qr-modal-panel {
    color: #ffffff;
    display: grid;
    gap: 0.85rem;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    height: 100%;
    max-width: 720px;
    width: 100%;
}

.qr-modal-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.qr-modal-header span {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.1;
}

.qr-modal-header h2 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    font-weight: 850;
    line-height: 1;
    margin: 0.15rem 0 0;
}

.qr-modal-panel .qr-box {
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 0.7rem;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    padding: 0;
}

.qr-modal-panel #reader {
    align-items: center;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

.face-preview {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    width: 100%;
}

.face-confirm-panel {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    color: #0f172a;
    padding: 1rem;
}

.face-failure-panel {
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 1rem;
}

.qr-modal-panel #reader video,
.qr-modal-panel #reader canvas {
    border-radius: 18px;
    height: 100% !important;
    max-height: 100% !important;
    max-width: 100% !important;
    object-fit: cover;
    width: 100% !important;
}

.qr-modal-panel .trouble-link {
    color: rgba(255, 255, 255, 0.82);
    justify-self: center;
}

.qr-modal-panel .manual-qr-form {
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
}

.qr-message {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
}

.qr-message-info {
    background: #eef6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.qr-message-success {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.qr-message-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.camera-diagnostics {
    display: grid;
    gap: 1rem;
}

.camera-status {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1d4ed8;
    font-weight: 700;
    padding: 0.75rem;
}

.camera-status-success {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.camera-status-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.camera-facts {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.camera-facts div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.camera-facts span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.camera-facts strong {
    display: block;
    overflow-wrap: anywhere;
}

.camera-preview {
    aspect-ratio: 4 / 3;
    background: #0f172a;
    border-radius: 8px;
    min-height: 220px;
    object-fit: cover;
    width: 100%;
}

.camera-list {
    margin-bottom: 0.75rem;
}

.camera-errors {
    background: #111827;
    border-radius: 8px;
    color: #f8fafc;
    font-size: 0.85rem;
    max-height: 280px;
    overflow: auto;
    padding: 0.85rem;
    white-space: pre-wrap;
}

.qr-diagnostics {
    margin-bottom: 0.75rem;
}

#reader {
    overflow: hidden;
}

#reader video,
#reader canvas {
    max-width: 100% !important;
}

.qr-front-camera #reader video {
    transform: scaleX(-1);
}

.qr-scan-instruction {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0.5rem 0 0.75rem;
    text-align: center;
}

.qr-modal-panel .qr-scan-instruction {
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.1rem;
    margin: 0;
}

.qr-thumb {
    height: 72px;
    width: 72px;
}

.toast-area {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    pointer-events: none;
    position: fixed;
    right: 1rem;
    top: 5rem;
    width: min(420px, calc(100vw - 2rem));
    z-index: 1100;
}

.flash-message {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    margin: 0;
    overflow-wrap: anywhere;
    pointer-events: auto;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.flash-message.flash-fade-out {
    opacity: 0;
    transform: translateY(-8px);
}

.flash-check {
    font-weight: 800;
}

.face-enrollment-modal-area {
    background: rgba(7, 15, 28, 0.96);
    display: none;
    inset: 0;
    overflow-y: auto;
    padding: 1rem;
    position: fixed;
    z-index: 1300;
}

body.face-enrollment-mode {
    overflow: hidden;
}

body.face-enrollment-mode .face-enrollment-modal-area {
    display: block;
}

.enrollment-device-label {
    color: #dbeafe;
    font-size: 1rem;
    margin: 0.75rem 0 1rem;
    text-align: center;
}

.enrollment-session-list {
    display: grid;
    gap: 0.75rem;
}

.enrollment-session-card {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.enrollment-session-card > div {
    display: grid;
    gap: 0.2rem;
}

.enrollment-session-card span {
    color: #475569;
    font-size: 0.9rem;
}

@media (max-width: 767.98px) {
    .enrollment-session-card {
        align-items: stretch;
        flex-direction: column;
    }

    .enrollment-session-card .btn {
        min-height: 56px;
        width: 100%;
    }
}

.kiosk-submit-status {
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 800;
    padding: 0.85rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.kiosk-submit-status-info {
    background: #eef6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.kiosk-submit-status-success {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.kiosk-submit-status-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.settings-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.settings-list dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.location-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, 1fr);
}

.location-list div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.location-list span {
    color: var(--muted);
    display: block;
}

.mobile-tabbar {
    background: #ffffff;
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, 1fr);
    left: 0;
    padding: 0.35rem;
    position: fixed;
    right: 0;
    z-index: 1040;
}

.mobile-tabbar button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    min-height: 48px;
}

.mobile-tabbar button.active {
    background: #e8f1f8;
    color: #008da9;
}

.pb-mobile-nav {
    padding-bottom: 0;
}

@media (max-width: 575px) {
    .mobile-tabbar {
        display: none;
    }

    .location-app-shell {
        max-width: none;
        padding: 0.45rem !important;
        width: 100%;
    }

    .location-app-header {
        border-radius: 18px;
        margin-bottom: 0.75rem;
        min-height: 116px;
        padding: 1.05rem 1rem;
    }

    .location-title-block h1 {
        font-size: 2rem;
        line-height: 1;
    }

    .location-kicker {
        font-size: 0.85rem;
    }

    .location-brand {
        font-size: 1.1rem;
    }

    .location-title-block span {
        font-size: 1.2rem;
    }

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

    .person-row,
    .inside-card,
    .location-header,
    .panel-heading {
        display: block;
    }

    .mobile-actions,
    .location-list,
    .visitor-grid,
    .qr-actions,
    .staff-kiosk-grid {
        grid-template-columns: 1fr;
    }

.staff-qr-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-manual-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-qr-area {
        display: block;
    }

    .location-app-page.qr-mode #qrCameraBox {
        display: block;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 58px;
    }

    .toast-area {
        left: 1rem;
        top: 4.5rem;
    }

    .pb-mobile-nav {
        padding-bottom: 0.75rem;
    }

    .panel {
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
        padding: 1rem;
    }

    .panel-heading {
        margin-bottom: 0.9rem;
    }

    .panel-heading h2 {
        font-size: 1.35rem;
    }

    .form-label {
        font-size: 1.125rem;
        font-weight: 700;
        margin-bottom: 0.45rem;
    }

    .visitor-grid,
    .stack-form {
        gap: 0.95rem;
    }

    .btn-lg,
    .form-control-lg,
    .form-select-lg {
        font-size: 1.25rem;
        min-height: 64px;
    }

    .form-select,
    .form-control {
        font-size: 1.18rem;
        min-height: 62px;
    }

    .btn {
        font-size: 1.18rem;
        font-weight: 700;
    }

    .btn-primary.btn-lg,
    .btn-outline-primary.btn-lg {
        font-size: 1.32rem;
        min-height: 68px;
    }

    .mobile-top-tabs {
        border-radius: 14px;
        gap: 0.45rem;
        margin-bottom: 0.85rem;
        padding: 0.4rem;
        top: 0.35rem;
    }

    .mobile-top-tabs button {
        font-size: 1.18rem;
        min-height: 66px;
    }

    .kiosk-card {
        min-height: 0;
    }

    .qr-box {
        padding: 0.85rem;
    }

    #reader {
        min-height: 0;
    }

    .manual-qr-form {
        background: #f8fafc;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0.85rem;
    }

    .staff-kiosk-grid {
        gap: 0.95rem;
    }

    .staff-manual-area,
    .staff-qr-area {
        width: 100%;
    }

    #showQrMode {
        margin-top: 0.95rem !important;
    }

    .qr-mobile-actions {
        gap: 0.95rem;
    }

    .trouble-link {
        font-size: 1rem;
        margin-top: 0.9rem;
    }

    .staff-current-status {
        grid-template-columns: 1fr;
    }

    .compact-list,
    .activity-feed {
        max-height: calc(100vh - 12.5rem);
    }

    .inside-card,
    .activity-feed-item {
        padding: 0.75rem;
    }

    .inside-card form {
        margin-top: 0.65rem;
    }

    .inside-card .btn {
        width: 100%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .mobile-tabbar {
        display: none;
    }

    .location-app-shell {
        padding: 0.85rem !important;
    }

    .visitor-grid,
    .qr-actions,
    .staff-kiosk-grid {
        grid-template-columns: 1fr;
    }

    .staff-qr-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-manual-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-qr-area {
        display: block;
    }

    .location-app-page.qr-mode #qrCameraBox {
        display: block;
    }

    .pb-mobile-nav {
        padding-bottom: 0.75rem;
    }
}

@media (min-width: 768px) {
    .staff-qr-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-manual-area {
        display: none;
    }

    .location-app-page.qr-mode .staff-qr-area {
        display: block;
    }

    .location-app-page.qr-mode #qrCameraBox {
        display: block;
    }
}

@media (max-width: 768px) {
    .location-app-shell {
        max-width: none !important;
        padding: 8px !important;
        width: 100% !important;
    }

    .location-app-header {
        border-radius: 20px !important;
        min-height: 112px !important;
        padding: 16px !important;
    }

    .location-title {
        font-size: 26px !important;
        line-height: 1.05 !important;
    }

    .inside-count {
        font-size: 18px !important;
    }

    .location-kicker {
        font-size: 15px !important;
    }

    .location-brand {
        font-size: 18px !important;
        font-weight: 800 !important;
    }

    .staff-kiosk-grid,
    .staff-manual-area,
    .staff-qr-area,
    .kiosk-card,
    .action-panel {
        max-width: none !important;
        width: 100% !important;
    }

    .staff-kiosk-grid {
        display: block !important;
    }

    .kiosk-card {
        border-radius: 18px !important;
        padding: 16px !important;
    }

    .kiosk-tabs {
        border-radius: 18px !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
        padding: 8px !important;
    }

    .kiosk-tabs button,
    .kiosk-tabs .nav-link {
        font-size: 18px !important;
        font-weight: 800 !important;
        min-height: 52px !important;
    }

    .kiosk-card label,
    .kiosk-card h2,
    .kiosk-card h3,
    .kiosk-card p {
        font-size: 18px !important;
    }

    .kiosk-card h2 {
        font-size: 22px !important;
    }

    .kiosk-card select,
    .kiosk-card input,
    .kiosk-card .form-select,
    .kiosk-card .form-control {
        font-size: 18px !important;
        min-height: 56px !important;
    }

    .kiosk-card .btn,
    .kiosk-card button {
        font-size: 20px !important;
        font-weight: 800 !important;
        min-height: 58px !important;
    }

    .stack-form {
        gap: 14px !important;
    }

    #showQrMode {
        margin-top: 14px !important;
    }
}

body.location-app-page.qr-mode .staff-qr-area,
body.location-app-page.face-mode .face-modal-area {
    display: flex !important;
    max-width: none !important;
    width: auto !important;
}

body.location-app-page.qr-mode #qrCameraBox {
    display: grid !important;
}

body.location-app-page.qr-mode .qr-modal-panel .qr-box {
    padding: 0 !important;
}

body.location-app-page.qr-mode .qr-modal-panel .trouble-link {
    margin-top: 0 !important;
}

.handover-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.handover-steps span {
    background: #eef2ff;
    border: 1px solid #dbe4ff;
    border-radius: 999px;
    color: #3730a3;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
}

.vehicle-handover-form .panel {
    border-radius: 12px;
}

.vehicle-detail-card {
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 1rem;
}

.vehicle-detail-card div {
    display: grid;
    gap: 0.2rem;
}

.vehicle-detail-card span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.vehicle-detail-card strong {
    color: #111827;
    font-size: 1.1rem;
}

.condition-row {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
    margin-bottom: 0.85rem;
    padding: 1rem;
}

.return-condition-list,
.return-condition-card {
    display: grid;
    gap: 0.85rem;
}

.return-condition-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    grid-template-columns: minmax(0, 0.8fr) minmax(260px, 1fr);
    margin-bottom: 0.85rem;
    padding: 1rem;
}

.condition-row .btn-group .btn {
    min-height: 44px;
}

.photo-grid,
.handover-photo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.photo-upload-preview {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.photo-preview-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 0.65rem;
}

.photo-preview-item img {
    aspect-ratio: 1 / 1;
    background: #e5e7eb;
    border-radius: 10px;
    object-fit: cover;
    width: 92px;
}

.photo-preview-item strong,
.photo-preview-item span {
    display: block;
}

.photo-preview-item span,
.photo-slot-empty {
    color: #64748b;
    font-size: 0.9rem;
}

.photo-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.handover-photo-grid a {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: inherit;
    display: grid;
    gap: 0.5rem;
    overflow: hidden;
    text-decoration: none;
}

.handover-photo-grid img {
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    object-fit: cover;
    width: 100%;
}

.handover-photo-grid span {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0 0.75rem 0.75rem;
}

.signature-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
}

.signature-canvas {
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    display: block;
    height: 190px;
    touch-action: none;
    width: 100%;
}

.signature-preview {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: block;
    margin-top: 0.5rem;
    max-height: 180px;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    body:has(.vehicle-handover-form) main,
    body:has(.handover-mobile-card-list) main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .vehicle-handover-form,
    .vehicle-handover-form .row,
    .vehicle-handover-form [class*="col-"],
    .handover-filter-panel .row,
    .handover-filter-panel [class*="col-"],
    .handover-admin-form,
    .handover-admin-form [class*="col-"] {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
        width: 100%;
    }

    .vehicle-handover-form [class*="col-"],
    .handover-filter-panel [class*="col-"],
    .handover-admin-form [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }

    .vehicle-handover-form .form-control,
    .vehicle-handover-form .form-select,
    .handover-filter-panel .form-control,
    .handover-filter-panel .form-select,
    .handover-admin-card .form-control,
    .handover-admin-card .form-select {
        font-size: 16px;
        min-height: 46px;
    }

    .vehicle-handover-form .btn,
    .handover-card-actions .btn,
    .handover-admin-card .btn,
    .handover-filter-panel .btn,
    .photo-preview-actions .btn {
        font-size: 16px;
        min-height: 44px;
    }

    .handover-steps {
        flex-wrap: nowrap;
        margin-left: -2px;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        scrollbar-width: thin;
    }

    .handover-steps span {
        flex: 0 0 auto;
        min-height: 38px;
        white-space: nowrap;
    }

    .vehicle-handover-form .panel {
        padding: 1rem;
    }

    .condition-row {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }

    .return-condition-card {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }

    .vehicle-detail-card {
        grid-template-columns: 1fr;
    }

    .vehicle-detail-card strong {
        font-size: 1.25rem;
    }

    .condition-row .btn-group {
        flex-direction: column;
    }

    .condition-row .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.35rem;
    }

    .signature-canvas {
        height: 200px;
    }

    body.is-signing {
        overflow: hidden;
        touch-action: none;
    }

    .photo-preview-item {
        grid-template-columns: 1fr;
    }

    .photo-preview-item img {
        aspect-ratio: 4 / 3;
        width: 100%;
    }

    .photo-preview-actions .btn {
        flex: 1 1 120px;
    }

    .handover-submit-panel {
        background: rgba(255, 255, 255, 0.96);
        border-radius: 0;
        bottom: 0;
        box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
        margin-left: -12px;
        margin-right: -12px;
        padding-bottom: calc(0.85rem + env(safe-area-inset-bottom)) !important;
        position: sticky;
        z-index: 20;
    }

    .handover-desktop-table {
        display: none;
    }

    .handover-mobile-card-list {
        display: grid;
        gap: 0.85rem;
    }

    .handover-record-card,
    .handover-admin-card {
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        display: grid;
        gap: 0.85rem;
        padding: 1rem;
    }

    .handover-record-card dl,
    .handover-admin-card dl {
        display: grid;
        gap: 0.35rem;
        grid-template-columns: 120px minmax(0, 1fr);
        margin-bottom: 0;
    }

    .handover-record-card dt,
    .handover-admin-card dt {
        color: #64748b;
        font-weight: 700;
    }

    .handover-record-card dd,
    .handover-admin-card dd {
        margin-bottom: 0;
        min-width: 0;
    }

    .handover-reference,
    .handover-registration {
        font-size: 1.2rem;
    }

    .handover-card-actions {
        display: grid;
        gap: 0.5rem;
        grid-template-columns: 1fr;
    }

    .handover-card-actions form,
    .handover-card-actions .btn {
        width: 100%;
    }

    .mobile-filter-details summary {
        cursor: pointer;
        font-size: 1rem;
        font-weight: 800;
        min-height: 44px;
        padding-top: 0.35rem;
    }
}

@media (min-width: 768px) {
    .handover-mobile-card-list,
    .mobile-filter-details > summary {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .qr-modal-panel {
        gap: 0.65rem;
    }

    .qr-modal-header {
        align-items: flex-start;
    }

    .qr-modal-header .btn {
        font-size: 0.95rem !important;
        min-height: 44px !important;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        white-space: nowrap;
    }

    .qr-modal-panel .qr-message {
        font-size: 1rem;
        margin-bottom: 0;
        padding: 0.7rem;
    }

    .qr-modal-panel .qr-scan-instruction {
        font-size: 1.05rem !important;
    }

    .qr-modal-panel #reader,
    .qr-modal-panel #reader video,
    .qr-modal-panel #reader canvas {
        border-radius: 16px;
    }
}

@media print {
    .navbar,
    .btn,
    .toast-area {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .panel,
    .stat-card {
        border: 0;
        box-shadow: none;
    }
}

.parts-mobile-shell {
    max-width: 860px;
    margin: 0 auto;
}

.parts-action-card .form-label {
    font-weight: 700;
}

.parts-summary-card dl {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 0.45rem 1rem;
    margin: 1rem 0 0;
}

.parts-summary-card dt {
    color: #64748b;
    font-weight: 700;
}

.parts-summary-card dd {
    margin: 0;
}

.parts-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.parts-qr-preview {
    width: 132px;
    height: 132px;
    margin-top: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.35rem;
    background: #fff;
}

@media (max-width: 767.98px) {
    .parts-mobile-shell {
        max-width: none;
    }

    .parts-action-card,
    .parts-summary-card {
        padding: 1rem;
    }

    .parts-action-card .form-control,
    .parts-action-card .form-select {
        min-height: 56px;
        font-size: 1.05rem;
    }

    .parts-action-card .btn-lg {
        min-height: 58px;
        font-size: 1.15rem;
    }

    .parts-summary-card dl {
        grid-template-columns: 120px minmax(0, 1fr);
        font-size: 0.98rem;
    }
}

/* Management control center */
.management-shell {
    --shell-bg: #f3f5f7;
    --shell-sidebar: var(--sos-charcoal);
    --shell-sidebar-muted: #aeb5ba;
    --shell-accent: var(--sos-cyan);
    --shell-accent-soft: #e4f6fa;
    --shell-coral: var(--sos-magenta);
    --shell-green: #008fae;
    --shell-amber: #a77d00;
    background: var(--shell-bg);
    min-height: 100vh;
}

.management-sidebar {
    --bs-offcanvas-bg: var(--sos-charcoal);
    --bs-offcanvas-color: #ffffff;
    background-color: var(--sos-charcoal) !important;
    border: 0;
    color: #fff;
    width: 256px !important;
}

.management-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    padding: 1.25rem 0.9rem 1rem;
}

.management-brand,
.management-mobile-brand {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
}

.management-brand {
    background: #ffffff;
    border-radius: 8px;
    color: #fff;
    margin: 0 0.35rem 1.35rem;
    padding: 0.65rem;
}

.management-brand:hover,
.management-mobile-brand:hover {
    color: inherit;
}

.management-brand strong,
.management-brand small,
.management-mobile-brand strong,
.management-mobile-brand small {
    display: block;
    line-height: 1.15;
}

.management-brand strong {
    font-size: 1rem;
}

.management-brand small {
    color: var(--shell-sidebar-muted);
    font-size: 0.78rem;
}

.brand-mark {
    align-items: center;
    background: #eaf6f3;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #11665f;
    display: inline-flex;
    flex: 0 0 38px;
    font-size: 0.8rem;
    font-weight: 800;
    height: 38px;
    justify-content: center;
}

.sos-logo {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.sos-logo-sidebar {
    margin: 0 auto;
    width: 184px;
}

.sos-logo-mobile {
    width: 122px;
}

.sos-logo-login {
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    width: 270px;
}

.sos-logo-kiosk {
    margin-bottom: 0.55rem;
    width: 205px;
}

.sos-logo-page {
    margin-left: auto;
    margin-right: auto;
    width: min(340px, 85%);
}

.management-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 0;
    overflow-y: auto;
}

.nav-section-label {
    color: #c8d0d4;
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    margin: 1.15rem 0.75rem 0.4rem;
    text-transform: uppercase;
}

.management-nav-link {
    align-items: center;
    border-radius: 7px;
    color: #f0f4f5;
    display: flex;
    font-size: 0.9rem;
    font-weight: 650;
    gap: 0.75rem;
    min-height: 42px;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.management-nav-link:hover {
    background: #363c42;
    color: #fff;
}

.management-nav-link.active {
    background: #ffffff !important;
    box-shadow: inset 4px 0 0 var(--sos-cyan);
    color: var(--sos-charcoal) !important;
}

.management-nav-link svg {
    flex: 0 0 19px;
    height: 19px;
    stroke-width: 2.25;
    width: 19px;
}

.management-nav-link .nav-external {
    height: 14px;
    margin-left: auto;
    opacity: 0.55;
    width: 14px;
}

.management-user {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    margin-top: 1rem;
    padding: 1rem 0.35rem 0;
}

.user-avatar,
.person-avatar {
    align-items: center;
    background: #e4f6fa;
    border-radius: 50%;
    color: #008daa;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
}

.user-avatar {
    height: 36px;
    width: 36px;
}

.user-copy {
    min-width: 0;
}

.user-copy strong,
.user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy strong {
    color: #fff;
    font-size: 0.84rem;
}

.user-copy span {
    color: var(--shell-sidebar-muted);
    font-size: 0.73rem;
}

.icon-button {
    align-items: center;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 7px;
    color: inherit;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    width: 36px;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.icon-button svg {
    height: 18px;
    width: 18px;
}

.management-user .icon-button {
    border-color: rgba(255, 255, 255, 0.16);
    color: #c9d6d8;
}

.management-mobile-header {
    display: none;
}

.management-main {
    max-width: none;
}

.page-frame {
    margin: 0 auto;
    max-width: 1480px;
}

.page-heading {
    align-items: flex-end;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-eyebrow {
    color: var(--shell-accent);
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.page-heading h1 {
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.15;
    margin: 0;
}

.page-heading p {
    color: #66747b;
    margin: 0.4rem 0 0;
}

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

.page-actions .btn,
.auth-form-panel .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: center;
}

.page-actions .btn svg,
.auth-form-panel .btn svg {
    height: 17px;
    width: 17px;
}

.page-actions .btn-outline-secondary {
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #6f7d84;
    --bs-btn-color: #27343a;
    --bs-btn-hover-bg: var(--sos-charcoal);
    --bs-btn-hover-border-color: var(--sos-charcoal);
    --bs-btn-hover-color: #ffffff;
}

.management-shell .btn-primary {
    --bs-btn-bg: var(--shell-accent);
    --bs-btn-border-color: var(--shell-accent);
    --bs-btn-hover-bg: #008da9;
    --bs-btn-hover-border-color: #008da9;
}

.dashboard-summary {
    background: #fff;
    border: 1px solid #dce2e5;
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(230px, 1.2fr) repeat(3, minmax(160px, 1fr));
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.summary-primary,
.summary-location {
    min-width: 0;
    padding: 1.1rem 1.25rem;
}

.summary-primary {
    align-items: center;
    background: var(--sos-charcoal);
    color: #fff;
    display: flex;
    gap: 1rem;
}

.summary-icon {
    align-items: center;
    background: #e4f6fa;
    border-radius: 7px;
    color: #008daa;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
}

.summary-icon svg {
    height: 21px;
    width: 21px;
}

.summary-primary strong,
.summary-primary span,
.summary-location strong,
.summary-location span,
.summary-location small {
    display: block;
}

.summary-primary strong {
    font-size: 1.8rem;
    line-height: 1;
}

.summary-primary span {
    color: #b8c9cc;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.summary-location {
    border-left: 1px solid #e5e9eb;
}

.summary-location span {
    color: #68767d;
    font-size: 0.78rem;
    font-weight: 700;
}

.summary-location strong {
    color: #1d2c31;
    font-size: 1.55rem;
    line-height: 1.2;
    margin-top: 0.2rem;
}

.summary-location small {
    color: #7d898f;
    font-size: 0.72rem;
}

.location-board {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.location-panel {
    background: #fff;
    border: 1px solid #dce2e5;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
}

.location-panel:nth-child(1) {
    border-top: 4px solid var(--sos-cyan);
}

.location-panel:nth-child(2) {
    border-top: 4px solid var(--sos-magenta);
}

.location-panel:nth-child(3) {
    border-top: 4px solid var(--sos-yellow);
}

.location-panel-header {
    align-items: center;
    border-bottom: 1px solid #e5e9eb;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
}

.location-panel-header > div {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.location-panel-header .icon-button {
    border-color: #cfd8db;
    color: #526269;
    flex: 0 0 36px;
}

.location-pin {
    align-items: center;
    background: #e4f6fa;
    border-radius: 7px;
    color: #008daa;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
}

.location-pin svg {
    height: 19px;
    width: 19px;
}

.location-panel-header h2 {
    font-size: 1rem;
    font-weight: 750;
    margin: 0;
}

.location-panel-header p {
    color: #7a878d;
    font-size: 0.75rem;
    margin: 0.15rem 0 0;
}

.people-section {
    padding: 0.9rem 1rem 1rem;
}

.people-section + .people-section {
    border-top: 1px solid #edf0f1;
}

.people-section-title {
    align-items: center;
    color: #65737a;
    display: flex;
    font-size: 0.72rem;
    font-weight: 800;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.people-section-title b {
    align-items: center;
    background: #eef2f3;
    border-radius: 999px;
    color: #45545a;
    display: inline-flex;
    font-size: 0.7rem;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 0.4rem;
}

.onsite-person {
    align-items: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 0.45rem 0;
}

.onsite-person + .onsite-person {
    border-top: 1px solid #f0f2f3;
}

.person-avatar {
    height: 34px;
    width: 34px;
}

.onsite-person.visitor .person-avatar {
    background: #fbe5ef;
    color: #a9004e;
}

.person-copy {
    min-width: 0;
}

.person-copy strong,
.person-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-copy strong {
    font-size: 0.86rem;
}

.person-copy span,
.onsite-person time {
    color: #7a878d;
    font-size: 0.72rem;
}

.onsite-person time {
    max-width: 88px;
    text-align: right;
}

.empty-state {
    align-items: center;
    color: #89959a;
    display: flex;
    font-size: 0.78rem;
    gap: 0.5rem;
    min-height: 48px;
}

.empty-state svg {
    height: 17px;
    width: 17px;
}

.control-summary {
    background: var(--sos-charcoal);
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 1.5rem;
    padding: 0.45rem;
}

.control-summary > div {
    align-items: center;
    color: #fff;
    display: flex;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
}

.control-summary > div + div {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.control-summary p,
.control-summary strong,
.control-summary p span {
    display: block;
    margin: 0;
}

.control-summary strong {
    font-size: 1.5rem;
    line-height: 1;
}

.control-summary p span {
    color: #b8c9cc;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.summary-icon.neutral {
    background: #dbeceb;
}

.summary-icon.success {
    background: #e4f0e8;
    color: var(--shell-green);
}

.summary-icon.warning {
    background: #f9eddc;
    color: var(--shell-amber);
}

.control-sections {
    display: grid;
    gap: 2rem;
}

.control-section > header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.control-section > header h2 {
    font-size: 1.05rem;
    font-weight: 750;
    margin: 0;
}

.control-section > header p {
    color: #76848a;
    font-size: 0.8rem;
    margin: 0.2rem 0 0;
}

.control-section > header > svg {
    color: #93a0a5;
    height: 20px;
    width: 20px;
}

.control-link-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-link {
    align-items: center;
    background: #fff;
    border: 1px solid #dce2e5;
    border-radius: 8px;
    color: #233238;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 42px minmax(0, 1fr) auto 20px;
    min-height: 78px;
    padding: 0.8rem 0.9rem;
    text-decoration: none;
}

.control-link:hover {
    border-color: #8db8b3;
    box-shadow: 0 6px 18px rgba(26, 48, 53, 0.07);
    color: #233238;
}

.control-icon {
    align-items: center;
    background: #e4f6fa;
    border-radius: 7px;
    color: #008daa;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.control-link:nth-child(4n + 2) .control-icon {
    background: #fbe5ef;
    color: var(--sos-magenta);
}

.control-link:nth-child(4n + 3) .control-icon {
    background: #fff6cf;
    color: #9a7600;
}

.control-link:nth-child(4n + 4) .control-icon {
    background: #e8eaec;
    color: var(--sos-charcoal);
}

.control-icon svg {
    height: 20px;
    width: 20px;
}

.control-copy,
.control-copy strong,
.control-copy small {
    display: block;
    min-width: 0;
}

.control-copy strong {
    font-size: 0.9rem;
}

.control-copy small {
    color: #748187;
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.2rem;
}

.control-status {
    background: #edf2f3;
    border-radius: 999px;
    color: #526168;
    font-size: 0.7rem;
    font-weight: 800;
    max-width: 92px;
    overflow: hidden;
    padding: 0.25rem 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.control-arrow {
    color: #9aa5a9;
    height: 17px;
    width: 17px;
}

/* Login */
.auth-page {
    background: #e9eeef;
    min-height: 100vh;
}

.auth-main {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 1.25rem !important;
}

.auth-shell {
    background: #fff;
    border: 1px solid #d6dddf;
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1fr);
    margin: 0 auto;
    max-width: 860px;
    min-height: 510px;
    overflow: hidden;
    width: 100%;
}

.auth-brand-panel {
    background: var(--sos-charcoal);
    border-top: 6px solid var(--sos-cyan);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
}

.brand-mark-large {
    height: 52px;
    margin-bottom: 1.5rem;
    width: 52px;
}

.auth-kicker {
    color: #9fc3bf;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
}

.auth-brand-panel h1 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.auth-brand-panel > p:last-child {
    color: #b8c9cc;
    margin: 0;
}

.auth-form-panel {
    align-self: center;
    padding: 2.75rem;
}

.auth-form-heading {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.auth-icon {
    align-items: center;
    background: #e4f6fa;
    border-radius: 8px;
    color: #008daa;
    display: inline-flex;
    flex: 0 0 46px;
    height: 46px;
    justify-content: center;
}

.auth-icon svg {
    height: 22px;
    width: 22px;
}

.auth-form-heading h2 {
    font-size: 1.35rem;
    margin: 0;
}

.auth-form-heading p {
    color: #78858b;
    font-size: 0.8rem;
    margin: 0.25rem 0 0;
}

@media (min-width: 992px) {
    .management-sidebar {
        bottom: 0;
        left: 0;
        position: fixed !important;
        top: 0;
        z-index: 1030;
    }

    .management-shell .management-main {
        margin-left: 256px;
        padding: 2rem !important;
        width: calc(100% - 256px);
    }
}

@media (max-width: 1199.98px) {
    .location-board {
        grid-template-columns: 1fr;
    }

    .dashboard-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .summary-primary {
        grid-column: 1 / -1;
    }

    .summary-location:first-of-type {
        border-left: 0;
    }
}

@media (max-width: 991.98px) {
    .management-mobile-header {
        align-items: center;
        background: #fff;
        border-bottom: 1px solid #dce2e5;
        display: flex;
        height: 64px;
        justify-content: space-between;
        padding: 0 1rem;
        position: sticky;
        top: 0;
        z-index: 1025;
    }

    .management-mobile-brand {
        color: #1b3034;
    }

    .management-mobile-brand strong {
        font-size: 0.86rem;
    }

    .management-mobile-brand small {
        color: #718087;
        font-size: 0.68rem;
    }

    .management-mobile-header .icon-button {
        border-color: #cbd4d7;
        color: #34464c;
    }

    .management-sidebar .offcanvas-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .management-sidebar .btn-close {
        filter: invert(1);
    }

    .management-sidebar-inner {
        min-height: calc(100vh - 57px);
    }

    .management-brand {
        display: none;
    }

    .management-main {
        padding: 1.25rem !important;
    }
}

@media (max-width: 767.98px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 1.1rem;
    }

    .page-heading h1 {
        font-size: 1.65rem;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
    }

    .summary-primary {
        grid-column: auto;
    }

    .summary-location {
        align-items: center;
        border-left: 0;
        border-top: 1px solid #e5e9eb;
        display: grid;
        gap: 0.1rem 0.75rem;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0.8rem 1rem;
    }

    .summary-location strong {
        grid-column: 2;
        grid-row: 1 / 3;
        margin: 0;
    }

    .summary-location small {
        grid-column: 1;
    }

    .control-summary {
        grid-template-columns: 1fr;
    }

    .control-summary > div + div {
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .control-link-grid {
        grid-template-columns: 1fr;
    }

    .control-link {
        grid-template-columns: 42px minmax(0, 1fr) auto 18px;
    }

    .auth-main {
        align-items: flex-start;
        padding: 0 !important;
    }

    .auth-shell {
        border: 0;
        border-radius: 0;
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .auth-brand-panel {
        min-height: 210px;
        padding: 1.5rem;
    }

    .auth-brand-panel h1 {
        font-size: 1.55rem;
        margin-bottom: 0.5rem;
    }

    .brand-mark-large {
        height: 42px;
        margin-bottom: 1rem;
        width: 42px;
    }

    .auth-form-panel {
        padding: 1.5rem;
    }
}
