:root {
    --bg: oklch(0.965 0.008 220);
    --surface: oklch(0.998 0 0);
    --surface-2: oklch(0.94 0.011 222);
    --surface-3: oklch(0.9 0.016 222);
    --sidebar: oklch(0.24 0.043 229);
    --sidebar-2: oklch(0.3 0.04 229);
    --text: oklch(0.22 0.027 232);
    --muted: oklch(0.42 0.026 232);
    --line: oklch(0.84 0.017 222);
    --primary: oklch(0.46 0.11 178);
    --primary-dark: oklch(0.34 0.09 178);
    --primary-soft: oklch(0.93 0.037 178);
    --online: oklch(0.36 0.14 150);
    --online-soft: oklch(0.92 0.07 150);
    --offline: oklch(0.45 0.19 28);
    --offline-soft: oklch(0.94 0.065 28);
    --used: var(--online);
    --used-soft: var(--online-soft);
    --available: var(--offline);
    --available-soft: var(--offline-soft);
    --warning: oklch(0.38 0.08 75);
    --warning-soft: oklch(0.955 0.05 82);
    --focus: oklch(0.62 0.16 196);
    --radius: 8px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: inherit;
}

.app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1fr) auto;
    gap: var(--space-4);
    align-items: center;
    min-height: 76px;
    padding: var(--space-3) var(--space-5);
    background: var(--sidebar);
    color: oklch(0.94 0.014 220);
    border-bottom: 1px solid oklch(0.36 0.035 229);
}

.brand-block {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.brand-mark {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

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

.brand-block small {
    margin-top: 2px;
    color: oklch(0.76 0.02 222);
    font-size: 12px;
}

.header-nav {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
}

.header-nav a {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: var(--radius);
    border: 1px solid transparent;
    color: oklch(0.83 0.018 222);
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
    background: var(--sidebar-2);
    border-color: oklch(0.43 0.042 229);
    color: #fff;
}

.header-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-nav svg path:first-child:last-child,
.header-nav svg path:first-child {
    fill: none;
}

.header-note {
    max-width: 320px;
    justify-self: end;
    color: oklch(0.82 0.018 222);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.header-user-chip {
    border-color: oklch(0.39 0.035 229);
    background: var(--sidebar-2);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.workspace {
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: var(--space-5);
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.topbar-copy {
    display: grid;
    gap: var(--space-1);
}

.page-kicker {
    margin: 0;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
    text-wrap: balance;
}

h1 {
    font-size: 28px;
    line-height: 1.15;
}

h2 {
    font-size: 18px;
    line-height: 1.25;
}

p {
    margin: 0;
}

.topbar-copy p:last-child,
.panel-head p,
.section-head p {
    color: var(--muted);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 6px 6px 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
}

.user-chip form {
    margin: 0;
}

main {
    display: grid;
    gap: var(--space-5);
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: var(--space-5) var(--space-6) var(--space-7);
}

button,
input,
select,
textarea {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--surface);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: oklch(0.45 0.018 230);
}

button {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: 8px 14px;
    white-space: nowrap;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

button:disabled {
    background: oklch(0.7 0.016 230);
    border-color: oklch(0.7 0.016 230);
    cursor: not-allowed;
}

button.secondary {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

button.secondary:hover {
    background: oklch(0.885 0.055 176);
}

.logout-button {
    min-height: 30px;
    border-color: var(--line);
    background: var(--surface);
    color: var(--muted);
    padding: 5px 10px;
}

.icon-logout-button {
    display: inline-grid;
    width: 34px;
    min-height: 34px;
    padding: 0;
    place-items: center;
}

.icon-logout-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logout-button:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.danger-button {
    border-color: var(--used);
    background: var(--used);
}

.danger-button:hover {
    border-color: oklch(0.37 0.14 25);
    background: oklch(0.37 0.14 25);
}

:is(button, input, select, textarea, a):focus-visible {
    outline: 3px solid color-mix(in oklch, var(--focus) 36%, transparent);
    outline-offset: 2px;
}

.flash {
    padding: 12px 14px;
    border: 1px solid oklch(0.76 0.06 176);
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.flash.error {
    border-color: oklch(0.77 0.075 25);
    background: var(--used-soft);
    color: var(--used);
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) repeat(2, minmax(220px, 0.9fr));
    gap: var(--space-4);
}

.page-intro {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.page-intro div {
    display: grid;
    gap: var(--space-1);
}

.page-intro p,
.quick-link span {
    color: var(--muted);
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.quick-link {
    display: grid;
    gap: var(--space-2);
    min-height: 108px;
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
}

.quick-link:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.quick-link strong {
    color: var(--text);
}

.range-summary-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.section-title-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.summary-table-wrap {
    overflow-x: auto;
}

.summary-table {
    min-width: 760px;
}

.summary-table td:first-child {
    display: grid;
    gap: 2px;
}

.summary-table td:first-child span {
    color: var(--muted);
    font-size: 12px;
}

.mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.summary-actions {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
    white-space: nowrap;
}

.summary-actions form {
    margin: 0;
}

.mini-delete-button {
    min-height: 28px;
    border-color: var(--offline);
    background: var(--offline-soft);
    color: var(--offline);
    padding: 5px 10px;
    font-size: 13px;
}

.mini-delete-button:hover {
    border-color: var(--offline);
    background: var(--offline);
    color: #fff;
}

.summary-panel,
.panel,
.list-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.summary-panel {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
}

.summary-panel div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: end;
}

.summary-label {
    color: var(--muted);
    font-weight: 800;
}

.summary-panel strong {
    color: var(--text);
    font-size: 34px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.summary-panel p {
    color: var(--muted);
    font-size: 13px;
}

.primary-summary {
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.used-summary {
    background: var(--used-soft);
}

.used-summary .summary-label,
.used-summary strong {
    color: var(--used);
}

.available-summary {
    background: var(--available-soft);
}

.available-summary .summary-label,
.available-summary strong {
    color: var(--available);
}

.work-grid,
.management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
    gap: var(--space-5);
    align-items: start;
}

.single-column {
    grid-template-columns: minmax(0, 820px);
}

.ranges-management-grid {
    grid-template-columns: minmax(320px, 0.34fr) minmax(0, 1fr);
    gap: var(--space-4);
}

.users-management-grid {
    grid-template-columns: minmax(300px, 0.32fr) minmax(0, 1fr);
    gap: var(--space-4);
}

.panel {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-5);
}

.range-panel {
    position: sticky;
    top: 96px;
}

.user-panel {
    position: sticky;
    top: 96px;
}

.range-panel textarea {
    min-height: 88px;
    resize: vertical;
}

.ranges-list-section {
    overflow: hidden;
}

.ranges-list-section .section-title-row {
    align-items: start;
}

.ranges-list-section .section-title-row div {
    display: grid;
    gap: var(--space-1);
}

.ranges-list-section .section-title-row p {
    color: var(--muted);
    font-size: 13px;
}

.ranges-table {
    min-width: 820px;
}

.ranges-table th,
.ranges-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.users-list-section {
    overflow: hidden;
}

.users-table {
    min-width: 920px;
}

.users-table td:first-child {
    display: grid;
    gap: 2px;
}

.users-table td:first-child span {
    color: var(--muted);
    font-size: 12px;
}

.inline-password-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
    margin: 0;
}

.inline-password-form input {
    min-height: 30px;
    padding: 5px 8px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: start;
}

.panel-head div {
    display: grid;
    gap: var(--space-1);
}

.panel-head.compact {
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--line);
}

label {
    display: grid;
    gap: 6px;
    color: oklch(0.33 0.03 232);
    font-weight: 800;
}

.scan-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: var(--space-3);
    align-items: end;
}

.inventory-actions {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    gap: var(--space-3);
    align-items: end;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.compact-scan-form {
    grid-template-columns: minmax(260px, 520px) auto;
    align-items: end;
    gap: var(--space-2);
}

.compact-scan-form label {
    gap: 4px;
    margin: 0;
    font-size: 13px;
}

.compact-scan-form select,
.compact-scan-form button,
.compact-export-actions .button-link {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.compact-export-actions {
    align-self: end;
    grid-template-columns: repeat(3, 72px);
}

.scan-form.is-submitting {
    opacity: 0.82;
}

.scan-form.is-submitting select,
.scan-form.is-submitting button {
    cursor: wait;
}

.scan-working {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    padding: 12px;
    border: 1px solid oklch(0.74 0.06 178);
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.compact-scan-working {
    grid-column: 1 / -1;
    padding: 9px 10px;
}

.scan-working[hidden] {
    display: none;
}

.scan-working div {
    display: grid;
    gap: 2px;
}

.scan-working span:last-child {
    color: oklch(0.34 0.06 178);
    font-size: 13px;
    font-weight: 700;
}

.scan-spinner {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border: 3px solid oklch(0.77 0.06 178);
    border-top-color: var(--primary-dark);
    border-radius: 999px;
    animation: scan-spin 850ms linear infinite;
}

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

.scan-note {
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.export-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.button-link:hover {
    background: oklch(0.885 0.055 176);
}

.reset-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: var(--space-3);
    align-items: end;
}

.history-panel {
    min-height: 100%;
}

.history-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.28fr) minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
    min-height: 0;
    height: calc(100vh - 236px);
    max-height: 760px;
}

.session-list-panel {
    display: flex;
    max-height: 100%;
    min-height: 0;
    flex-direction: column;
    overflow: auto;
}

.history-panel .panel-head {
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--line);
}

.job-list {
    display: grid;
    gap: 2px;
}

.job {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    align-items: center;
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

.job:last-child {
    border-bottom: 0;
}

.job:hover,
.active-job {
    background: var(--primary-soft);
}

.job div {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.job strong {
    overflow: hidden;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job span,
.job small,
.empty-note {
    color: var(--muted);
}

.job small {
    white-space: nowrap;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.session-head {
    grid-template-columns: minmax(260px, 1fr) auto;
    padding: var(--space-3) var(--space-4);
}

.session-detail-section {
    display: flex;
    min-height: 0;
    max-height: 100%;
    flex-direction: column;
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.session-stats div {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-right: 1px solid var(--line);
}

.session-stats div:last-child {
    border-right: 0;
}

.session-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.session-stats strong {
    font-size: 14px;
}

.session-result-table {
    min-width: 920px;
}

.history-layout .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.list-section {
    overflow: hidden;
}

.section-head {
    display: grid;
    grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
    gap: var(--space-5);
    align-items: end;
    padding: var(--space-5);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.section-head div {
    display: grid;
    gap: var(--space-1);
}

.filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(128px, 0.55fr) minmax(136px, 0.6fr) auto;
    gap: var(--space-3);
    align-items: end;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 10px var(--space-5);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}

.status-note {
    color: var(--warning);
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    line-height: 1.25;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-2);
    color: oklch(0.35 0.03 232);
    font-size: 12px;
    font-weight: 900;
}

tbody tr {
    background: var(--surface);
}

tbody tr:hover {
    background: oklch(0.982 0.013 176);
}

td input,
td select {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 14px;
}

.ip-cell {
    color: oklch(0.27 0.06 220);
    font-family: Consolas, "Courier New", monospace;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 13px;
}

.readonly-cell {
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}

.monospace-cell {
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
}

.status-icon-cell {
    width: 52px;
    text-align: center;
}

table th:nth-child(4),
table td:nth-child(4),
table th:nth-child(5),
table td:nth-child(5) {
    min-width: 170px;
}

.device-status-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 14px;
    border: 1px solid oklch(0.52 0.055 225);
    border-radius: 2px;
    background: oklch(0.77 0.07 220);
    box-shadow: inset 0 0 0 2px oklch(0.92 0.025 220);
}

.device-status-icon.used {
    border-color: var(--used);
    background: oklch(0.82 0.075 150);
}

.device-status-icon.available {
    border-color: var(--available);
    background: oklch(0.86 0.055 28);
}

.device-status-icon::before {
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 8px;
    height: 4px;
    border-radius: 0 0 2px 2px;
    background: oklch(0.45 0.04 225);
    content: "";
    transform: translateX(-50%);
}

.device-status-icon::after {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--available);
    content: "";
    box-shadow: 0 0 0 1px oklch(0.78 0.025 220);
}

.device-status-icon.used::after {
    background: var(--used);
}

.device-status-icon.available::after {
    background: var(--available);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 13px;
    font-weight: 900;
}

.badge::before {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    content: "";
    background: currentColor;
    box-shadow: 0 0 0 2px oklch(1 0 0 / 0.8);
}

td button {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 13px;
}

.badge.used {
    background: var(--used-soft);
    border-color: oklch(0.63 0.11 150);
    color: var(--used);
}

.badge.available {
    background: var(--available-soft);
    border-color: oklch(0.67 0.13 28);
    color: var(--available);
}

.empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: flex-end;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.pagination a:hover,
.pagination .active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.pagination .disabled,
.pagination .dots {
    color: var(--muted);
    background: var(--surface-2);
}

.login-page {
    min-height: 100vh;
    background: var(--sidebar);
}

.login-shell {
    display: grid;
    width: min(100%, 520px);
    min-height: 100vh;
    place-items: center;
    padding: var(--space-5);
}

.login-panel {
    width: 100%;
    padding: var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.login-copy {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.login-copy .eyebrow {
    margin: 0;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
}

.login-copy p {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: var(--space-3);
}

.login-form button {
    width: 100%;
}

.login-note {
    margin: var(--space-4) 0 0;
    color: var(--muted);
    font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }

    .scan-spinner {
        animation: none;
        border-color: var(--primary-dark);
    }
}

@media (max-width: 1100px) {
    .app-header {
        grid-template-columns: auto 1fr auto;
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .header-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-top: var(--space-2);
    }

    .header-note {
        display: none;
    }

    .overview-grid,
    .quick-grid,
    .work-grid,
    .history-layout,
    .management-grid,
    .inventory-actions,
    .section-head {
        grid-template-columns: 1fr;
    }

    .session-list-panel {
        max-height: none;
    }

    .range-panel {
        position: static;
    }

    .user-panel {
        position: static;
    }

    .history-layout {
        height: auto;
        max-height: none;
    }

    .session-detail-section {
        max-height: none;
    }

    .history-layout .table-wrap {
        max-height: 560px;
    }

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

    .compact-export-actions {
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .user-chip {
        justify-content: space-between;
    }

    main,
    .app-header {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .app-header {
        grid-template-columns: auto 1fr auto;
        gap: var(--space-3);
    }

    .brand-block small,
    .header-note {
        display: none;
    }

    .header-nav {
        gap: var(--space-2);
        padding-top: 0;
    }

    .header-nav a {
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
    }

    .overview-grid,
    .quick-grid,
    .scan-form,
    .field-row,
    .filters,
    .reset-form,
    .export-actions,
    .compact-scan-form {
        grid-template-columns: 1fr;
    }

    .inventory-actions {
        padding: var(--space-3);
    }

    .summary-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-actions .mini-link,
    .summary-actions .mini-delete-button {
        width: 100%;
    }

    .inline-password-form {
        grid-template-columns: 1fr;
    }

    .page-intro {
        align-items: stretch;
        flex-direction: column;
    }

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

    .panel,
    .section-head {
        padding: var(--space-4);
    }

    .pagination {
        justify-content: flex-start;
    }
}
