:root {
    --bg0: #070a12;
    --bg1: #0b1020;
    --card: #0f1730;
    --line: rgba(255,255,255,.10);
    --text: rgba(255,255,255,.92);
    --muted: rgba(255,255,255,.65);
    --muted2: rgba(255,255,255,.45);
    --accent: #6be7ff;
    --ok: rgba(107,255,183,.95);
    --warn: rgba(255,214,107,.95);
    --crit: rgba(255,107,139,.95);
    --inactive: rgba(170,170,170,.85);
    --r: 16px;
    --shadow: 0 12px 34px rgba(0,0,0,.45);
    --shadow2: 0 10px 24px rgba(0,0,0,.35);
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color-scheme: dark;
    --sidebar-w: 320px;
    --topbar-h: 68px;
}

* {
    box-sizing: border-box;
    min-width: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: radial-gradient(1000px 700px at 20% 0%, rgba(107,231,255,.12), transparent 55%), radial-gradient(900px 650px at 85% 20%, rgba(145,111,255,.10), transparent 55%), linear-gradient(180deg, var(--bg0), var(--bg1));
    color: var(--text);
    overflow-x: hidden;
}

img,
svg,
canvas,
video {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.isHidden {
    display: none !important;
}

/* =========================
   LOGIN / ENTRY / ONBOARDING
========================= */
.login {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 9999;
}

.login__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.login__grid {
    position: absolute;
    inset: -2px;
    background-image: linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: .25;
}

.login__glow {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(38px);
    opacity: .28;
}

.login__glow--a {
    left: -120px;
    top: -140px;
    background: rgba(107,231,255,.40);
}

.login__glow--b {
    right: -160px;
    bottom: -160px;
    background: rgba(145,111,255,.36);
}

.login__card {
    position: relative;
    width: min(520px, 100%);
    max-width: 100%;
    background: linear-gradient(180deg, rgba(15,23,48,.88), rgba(10,15,32,.88));
    border: 1px solid var(--line);
    border-radius: calc(var(--r) + 8px);
    box-shadow: var(--shadow);
    padding: 28px 26px;
    backdrop-filter: blur(10px);
}

.login__logoImg {
    width: 110px;
    height: 110px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 10px 26px rgba(107,231,255,.18));
}

@media (min-width: 1100px) {
    .login__logoImg--xl {
        width: 140px;
        height: 140px;
    }
}

.login__title {
    text-align: center;
    margin: 0;
    font-size: 24px;
    letter-spacing: .3px;
}

.login__sub {
    text-align: center;
    margin: 8px 0 12px;
    color: var(--muted);
}

.dbgRow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 4px;
    flex-wrap: wrap;
}

.login__error {
    min-height: 18px;
    color: #ff9aa6;
    font-size: 13px;
    line-height: 1.35;
}

.login__foot {
    margin-top: 14px;
    text-align: center;
    color: var(--muted2);
    font-size: 12px;
}

.field {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

    .field label {
        font-size: 13px;
        color: var(--muted);
    }

.field__ghostLabel {
    visibility: hidden;
}

.smallMuted {
    font-size: 12px;
    color: var(--muted);
}

/* =========================
   GLOBAL FORM CONTROLS
========================= */
input,
select,
textarea,
.select,
.input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: rgba(16, 26, 43, 0.92);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    font: inherit;
}

    input:focus,
    select:focus,
    textarea:focus,
    .select:focus,
    .input:focus {
        border-color: rgba(56, 189, 248, 0.55);
        box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    }

    input::placeholder,
    textarea::placeholder {
        color: rgba(255, 255, 255, 0.45);
    }

    select option {
        background: #0b1220;
        color: rgba(255, 255, 255, 0.92);
    }

        select option[value=""] {
            color: rgba(255,255,255,.55);
        }

    input:disabled,
    select:disabled,
    textarea:disabled,
    .select:disabled,
    .input:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus {
        -webkit-text-fill-color: #ffffff;
        -webkit-box-shadow: 0 0 0px 1000px rgba(16, 26, 43, 0.92) inset;
        transition: background-color 5000s ease-in-out 0s;
    }

/* =========================
   BUTTONS
========================= */
.btn {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 14px;
    padding: 10px 12px;
    cursor: pointer;
    min-height: 42px;
    transition: transform .08s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

    .btn:hover {
        transform: translateY(-1px);
        border-color: rgba(255,255,255,.22);
    }

.btn--primary {
    background: linear-gradient(180deg, rgba(107,231,255,.20), rgba(107,231,255,.08));
    border-color: rgba(107,231,255,.35);
}

.btn--ghost {
    flex: 1;
}

.chip {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    min-height: 38px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
    white-space: nowrap;
}

    .chip:hover {
        transform: translateY(-1px);
    }

    .chip.isActive {
        border-color: rgba(107,231,255,.40);
        box-shadow: 0 0 0 3px rgba(107,231,255,.10);
    }

/* =========================
   APP SHELL
========================= */
.app {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-areas: "sidebar main";
}

.sidebar {
    grid-area: sidebar;
    min-height: 100dvh;
    padding: 14px;
    border-right: 1px solid var(--line);
    background: rgba(5,8,16,.55);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(255,255,255,.03);
}

.sidebar__logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.sidebar__text {
    min-width: 0;
}

.sidebar__title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
}

.sidebar__meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
    word-break: break-word;
}

.sidebar__nav {
    display: flex;
    gap: 8px;
}

.sidebar__nav--vertical {
    flex-direction: column;
}

.navBtn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 12px;
    cursor: pointer;
    transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
    text-align: left;
}

    .navBtn:hover {
        transform: translateY(-1px);
        border-color: rgba(107,231,255,.18);
    }

    .navBtn.isActive {
        border-color: rgba(107,231,255,.38);
        box-shadow: 0 0 0 3px rgba(107,231,255,.10);
        background: rgba(107,231,255,.07);
    }

.navIndicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    flex: 0 0 auto;
}

.navBtn.isActive .navIndicator {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(107,231,255,.55);
}

.navText {
    font-weight: 700;
    white-space: nowrap;
}

.sidebar__spacer {
    flex: 1;
}

.sidebar__bottom {
    display: flex;
    gap: 10px;
}

.main {
    grid-area: main;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: var(--topbar-h);
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: rgba(5,8,16,.35);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar__title {
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.05);
    color: var(--text);
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.panels {
    flex: 1;
    padding: 16px;
}

.panel {
    display: none;
}

    .panel.isActive {
        display: block;
    }

.panel__grid1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.panel__grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 16px;
}

/* =========================
   CARD
========================= */
.card {
    background: linear-gradient(180deg, rgba(15,23,48,.84), rgba(10,15,32,.84));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    box-shadow: var(--shadow2);
    overflow: hidden;
    min-width: 0;
}

.sectionCard {
    margin-bottom: 14px;
}

.card__head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.card__title {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .2px;
}

.card__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.card__bodyPad {
    padding: 14px 16px;
    min-width: 0;
}

.card__foot {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* =========================
   MAP / CHART
========================= */
.mapWrap {
    position: relative;
    min-height: 520px;
    height: 62vh;
    max-height: 860px;
}

.mapCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 520px;
}

.chartWrap {
    padding: 12px 14px;
    height: 360px;
    position: relative;
}

    .chartWrap canvas {
        width: 100% !important;
        height: 100% !important;
    }

#trendChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* =========================
   LEGEND / FORM
========================= */
.legendRow {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.legendItem {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.legendDot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

    .legendDot.isOk {
        background: var(--ok);
    }

    .legendDot.isWarn {
        background: var(--warn);
    }

    .legendDot.isCritical {
        background: var(--crit);
    }

    .legendDot.isInactive {
        background: var(--inactive);
    }

.formRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
    flex: 0 0 auto;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    transition: .2s;
    border-radius: 999px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 22px;
        width: 22px;
        left: 3px;
        top: 2px;
        background: rgba(255,255,255,.88);
        transition: .2s;
        border-radius: 999px;
    }

.switch input:checked + .slider {
    background: rgba(107,231,255,.18);
    border-color: rgba(107,231,255,.35);
}

    .switch input:checked + .slider:before {
        transform: translateX(24px);
    }

/* =========================
   EMPTY / LISTS / TABLES
========================= */
.emptyState {
    min-height: 160px;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

.emptyState__title {
    font-weight: 950;
    font-size: 16px;
}

.emptyState__sub {
    color: var(--muted);
    margin-top: 8px;
}

.emptyState--compact {
    padding: 18px;
    min-height: 160px;
}

.locationsList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: auto;
    padding-right: 6px;
}

.locationsList--panel {
    padding: 12px 14px;
    overflow: auto;
    flex: 1;
    max-height: 72vh;
}

.historyList {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
}

.tableScrollHost {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.adminTableHost {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.03);
}

    .adminTableHost table {
        width: 100%;
        min-width: 760px;
        border-collapse: collapse;
    }

    .adminTableHost th,
    .adminTableHost td {
        padding: 10px;
        border-bottom: 1px solid rgba(255,255,255,.06);
        text-align: left;
        vertical-align: top;
        font-size: 13px;
    }

    .adminTableHost th {
        font-weight: 700;
        opacity: .85;
    }

    .adminTableHost tr:hover td {
        background: rgba(255,255,255,.03);
    }

.roleSelect {
    min-width: 240px;
    min-height: 72px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.25);
    color: rgba(255,255,255,.92);
}

/* =========================
   DARKSELECT
========================= */
.dsNative {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ds {
    position: relative;
    width: 100%;
}

.dsBtn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(16, 26, 43, 0.92);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

    .dsBtn:focus {
        outline: none;
        border-color: rgba(107, 255, 183, 0.35);
        box-shadow: 0 0 0 3px rgba(107, 255, 183, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    }

.dsValue {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.95;
}

    .dsValue.isPlaceholder {
        opacity: 0.55;
    }

.dsChevron {
    opacity: 0.7;
    font-size: 12px;
    line-height: 1;
}

.dsMenu {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

    .dsMenu.isHidden {
        display: none;
    }

.dsSearchWrap {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.dsSearch {
    width: 100%;
    background: rgba(16, 26, 43, 0.92);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 9px 10px;
    outline: none;
}

.dsList {
    max-height: 260px;
    overflow: auto;
}

.dsOpt {
    padding: 10px 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.92);
}

    .dsOpt:hover,
    .dsOpt.isActive {
        background: rgba(255, 255, 255, 0.08);
    }

    .dsOpt.isSelected {
        background: rgba(107, 255, 183, 0.10);
    }

    .dsOpt.isDisabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* =========================
   SAMPLING
========================= */
.samplingGrid {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 1fr) minmax(120px, 150px) minmax(180px, .9fr) minmax(120px, 150px);
    gap: 12px;
    align-items: end;
}

.field--grow {
    min-width: 0;
}

.field--sm {
    min-width: 120px;
}

.field--submit {
    min-width: 120px;
}

.scanRow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 8px;
    align-items: center;
}

.scanBtn {
    width: 52px;
    min-width: 52px;
    padding: 10px 0;
    font-size: 18px;
}

.scannerHost {
    width: 100%;
    max-width: 560px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
}

/* =========================
   LAB / RACK HELPERS
========================= */
.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

.kanCol {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.03);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.kanHead {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.03);
}

.kanTitle {
    font-weight: 900;
    font-size: 13px;
}

.kanCount {
    font-size: 12px;
    color: var(--muted);
}

.kanList {
    padding: 10px;
    display: grid;
    gap: 8px;
    overflow: auto;
    max-height: 55vh;
}

.kanItem {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    padding: 10px;
    background: rgba(10,15,32,.55);
    cursor: pointer;
    transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease;
}

    .kanItem:hover {
        transform: translateY(-1px);
        border-color: rgba(107,231,255,.22);
    }

    .kanItem.isSelected {
        border-color: rgba(107,231,255,.45);
        box-shadow: 0 0 0 3px rgba(107,231,255,.10);
    }

.kanItemTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kanRack {
    font-weight: 950;
    letter-spacing: .2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanMeta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    display: grid;
    gap: 4px;
}

.rackCards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rackCard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    border-radius: 14px;
    cursor: pointer;
}

    .rackCard:hover {
        border-color: rgba(107,231,255,.22);
        transform: translateY(-1px);
    }

.rackCard__title {
    font-weight: 900;
}

.rackCard__sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

#labPanel .labGrid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px;
}

#labPanel.lab--overview .labGrid {
    grid-template-columns: 1fr 520px 360px;
}

#labOverviewWrap {
    display: none;
}

#labPanel.lab--overview #labOverviewWrap {
    display: block;
}

#labPanel #racksList {
    display: none !important;
}

#labPanel .labGrid,
#labPanel .labLayout,
#labPanel .labWrap {
    grid-template-columns: 1fr !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1400px) {
    .panel__grid2 {
        grid-template-columns: 1fr;
    }

    .samplingGrid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .field--submit {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .app {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .kanban {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 10px 12px 12px;
        gap: 10px;
        background: rgba(5,8,16,.88);
    }

    .sidebar__brand {
        padding: 10px 12px;
    }

    .sidebar__logo {
        width: 42px;
        height: 42px;
    }

    .sidebar__title {
        font-size: 16px;
    }

    .sidebar__spacer {
        display: none;
    }

    .sidebar__nav--vertical {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

        .sidebar__nav--vertical::-webkit-scrollbar {
            height: 8px;
        }

    .navBtn {
        width: auto;
        min-width: max-content;
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .sidebar__bottom {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .main {
        width: 100%;
        min-width: 0;
    }

    .topbar {
        top: 0;
        z-index: 20;
        padding: 12px 14px;
        min-height: 60px;
    }

    .topbar__title {
        font-size: 18px;
    }

    .topbar__right {
        justify-content: flex-end;
    }

    .panels {
        padding: 12px;
    }

    .panel__grid1,
    .panel__grid2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        border-radius: 18px;
    }

    .card__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .card__tools {
        justify-content: flex-start;
        width: 100%;
    }

        .card__tools > * {
            flex: 1 1 160px;
        }

    .mapWrap {
        min-height: 360px;
        height: 50vh;
        max-height: none;
    }

    .mapCanvas {
        min-height: 360px;
    }

    .chartWrap {
        height: 320px;
    }

    .locationsList--panel {
        max-height: none;
    }

    .kanban {
        grid-template-columns: 1fr;
    }

    .kanList {
        max-height: none;
    }

    .samplingGrid {
        grid-template-columns: 1fr;
    }

    .field--submit {
        grid-column: auto;
    }

    .scanBtn {
        min-height: 46px;
    }

    .scannerHost {
        max-width: 100%;
    }

    .formRow {
        align-items: center;
    }
}

@media (max-width: 640px) {
    .login {
        padding: 14px;
    }

    .login__card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .login__logoImg {
        width: 92px;
        height: 92px;
    }

    .login__title {
        font-size: 22px;
    }

    .dbgRow {
        flex-direction: column;
        gap: 6px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar__left,
    .topbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .sidebar__bottom {
        grid-template-columns: 1fr;
    }

    .card__tools > * {
        flex: 1 1 100%;
    }

    .mapWrap {
        min-height: 300px;
        height: 42vh;
    }

    .mapCanvas {
        min-height: 300px;
    }

    .chartWrap {
        height: 280px;
    }

    .legendRow {
        gap: 10px;
    }

    .adminTableHost table {
        min-width: 680px;
    }

    .rackCard {
        flex-direction: column;
        align-items: flex-start;
    }

    .formRow {
        flex-direction: row;
    }
}

@media (max-width: 420px) {
    .panels {
        padding: 10px;
    }

    .card__head,
    .card__bodyPad,
    .card__foot {
        padding-left: 12px;
        padding-right: 12px;
    }

    .navBtn {
        padding: 10px 11px;
    }

    .pill {
        padding: 7px 9px;
    }

    .mapWrap {
        min-height: 260px;
        height: 38vh;
    }

    .mapCanvas {
        min-height: 260px;
    }
}



#racksPanel.sampleOnlyMode .panel__grid1 {
    grid-template-columns: 1fr;
}

#racksPanel.sampleOnlyMode #samplingRegisterCard {
    margin-top: 0;
}

    #racksPanel.sampleOnlyMode #samplingRegisterCard .card__bodyPad {
        padding-top: 18px;
    }

#racksPanel.sampleOnlyMode #samplingYourRacksCard,
#racksPanel.sampleOnlyMode #samplingRacksStatusWrap,
#racksPanel.sampleOnlyMode #samplingRacksTableWrap,
#racksPanel.sampleOnlyMode #samplingPanelFoot,
#racksPanel.sampleOnlyMode #samplingTopTools {
    display: none !important;
     overflow: visible !important
}



/* Let dropdowns escape card/grid clipping */
.panel,
.panel__grid1,
.panel__grid2,
.card,
.card__bodyPad,
.samplingGrid,
.field {
    overflow: visible;
}

/* DarkSelect wrapper must allow floating menu */
.ds {
    position: relative;
    overflow: visible;
    z-index: 20;
}

/* The dropdown menu itself */
.dsMenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
}

/* When inside sampling area, keep it above nearby controls */
#racksPanel .ds,
#racksPanel .field,
#racksPanel .samplingGrid {
    overflow: visible;
}

#racksPanel .dsMenu {
    z-index: 10000;
}


.labDropZone {
    border: 2px dashed rgba(107,231,255,.35);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    background: rgba(255,255,255,.02);
    cursor: pointer;
    transition: .18s ease;
}

    .labDropZone:hover,
    .labDropZone.isDragOver {
        border-color: rgba(107,231,255,.85);
        background: rgba(107,231,255,.06);
        box-shadow: 0 0 0 1px rgba(107,231,255,.10) inset;
    }

.labDropZone__title {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,.94);
}

.labDropZone__sub {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.65);
}



.labDropZone {
    border: 2px dashed rgba(107,231,255,.35);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    background: rgba(255,255,255,.02);
    cursor: pointer;
    transition: .18s ease;
}

    .labDropZone:hover,
    .labDropZone.isDragOver {
        border-color: rgba(107,231,255,.85);
        background: rgba(107,231,255,.06);
        box-shadow: 0 0 0 1px rgba(107,231,255,.10) inset;
    }

.labDropZone__title {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,.94);
}

.labDropZone__sub {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.65);
}


.notifBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    background: rgba(255,107,139,.95);
    color: #fff;
}


.iconBellBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.92);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

    .iconBellBtn:hover {
        transform: translateY(-1px);
        border-color: rgba(107,231,255,.55);
        box-shadow: 0 0 0 3px rgba(107,231,255,.12);
    }

.iconBell {
    font-size: 18px;
    line-height: 1;
}

.iconBellBadge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #08111f;
    background: rgba(107,255,183,.95);
    box-shadow: 0 0 0 2px rgba(8,17,31,.9);
}

.iconBellBtn.hasUnread {
    border-color: rgba(107,255,183,.65);
    box-shadow: 0 0 0 4px rgba(107,255,183,.10);
}


.linkBtn {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

    .linkBtn:hover {
        text-decoration: underline;
    }


.locationsLayout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.locationsLeft,
.locationsRight {
    min-width: 0;
}




.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex: 0 0 auto;
}

    .switch input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
        pointer-events: none;
    }

.switchSlider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    transition: .2s ease;
}

    .switchSlider::before {
        content: "";
        position: absolute;
        height: 20px;
        width: 20px;
        left: 3px;
        top: 2px;
        border-radius: 50%;
        background: white;
        transition: .2s ease;
    }

.switch input:checked + .switchSlider {
    background: rgba(107,231,255,.28);
    border-color: rgba(107,231,255,.55);
}

    .switch input:checked + .switchSlider::before {
        transform: translateX(22px);
    }

.locationRow {
    user-select: none;
}

    .locationRow.isSelected {
        background: rgba(107,231,255,.06);
    }



#trendsPanel .card__tools,
#trendsPanel .trendTools,
#trendsPanel .trendsControls {
    min-width: 0;
}

#metricSelect.dsNative + .ds,
#rangeSelect.dsNative + .ds {
    min-width: 320px;
    width: 320px;
    max-width: 100%;
}

    #metricSelect.dsNative + .ds .dsBtn {
        min-height: 44px;
    }

    #metricSelect.dsNative + .ds .dsValue {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.2;
        padding-right: 28px;
    }

    #metricSelect.dsNative + .ds .dsMenu {
        min-width: 320px;
        max-width: 420px;
    }

    #metricSelect.dsNative + .ds .dsOpt {
        white-space: normal;
        line-height: 1.25;
        padding-top: 10px;
        padding-bottom: 10px;
    }


.ss-location-marker,
.ss-location-marker * {
    pointer-events: auto;
    cursor: pointer;
}