﻿:root {
    color-scheme: dark;

    --background: #111827;
    --background-secondary: #0b1220;
    --panel: #172033;
    --panel-hover: #1e293b;
    --border: #334155;

    --text: #f8fafc;
    --muted: #94a3b8;

    --accent: #facc15;
    --accent-hover: #fde047;

    --success: #86efac;

    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at top,
            #172033 0,
            var(--background) 420px
        );

    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: 70px;

    display: flex;
    align-items: center;

    padding: 0 28px;

    background: rgba(11, 18, 32, 0.94);
    backdrop-filter: blur(14px);

    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--text);
    text-decoration: none;

    font-weight: 750;
    font-size: 1.25rem;

    white-space: nowrap;
}

.brand-disc {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--accent);
    color: #111827;

    border: 3px solid #0b0f17;

    box-shadow:
        inset 0 0 0 6px #eab308,
        0 2px 5px rgba(0, 0, 0, 0.4);

    font-size: 0.65rem;
}

.main-navigation {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 4px;
}

.main-navigation button {
    border: 0;
    border-radius: 8px;

    padding: 10px 12px;

    background: transparent;
    color: var(--muted);

    transition:
        background 120ms ease,
        color 120ms ease;
}

.main-navigation button:hover,
.main-navigation button.active {
    background: var(--panel);
    color: var(--text);
}

.menu-button {
    display: none;

    margin-left: auto;

    padding: 8px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--panel);
    color: var(--text);

    font-size: 1.25rem;
}

.app-main {
    width: min(1180px, calc(100% - 40px));

    margin: 0 auto;
    padding: 52px 0 80px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 24px;

    margin-bottom: 34px;
}

.page-heading h1 {
    margin: 4px 0 8px;

    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.05;
}

.page-heading p:not(.eyebrow) {
    margin: 0;

    max-width: 700px;

    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    margin: 0;

    color: var(--accent);

    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    gap: 16px;

    margin-bottom: 42px;
}

.stat-card {
    min-height: 150px;

    display: flex;
    flex-direction: column;

    padding: 22px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(30, 41, 59, 0.95),
            rgba(23, 32, 51, 0.95)
        );
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-card strong {
    margin: 10px 0 3px;

    font-size: 2.5rem;
    line-height: 1;
}

.stat-detail {
    margin-top: auto;

    color: var(--muted);
    font-size: 0.8rem;
}

.section-title {
    margin: 0 0 16px;

    font-size: 1.2rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 14px;
}

.action-card {
    min-height: 112px;

    display: flex;
    align-items: center;

    gap: 18px;

    padding: 20px;

    text-align: left;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
    color: var(--text);

    transition:
        transform 120ms ease,
        background 120ms ease,
        border-color 120ms ease;
}

.action-card:hover {
    transform: translateY(-2px);

    background: var(--panel-hover);
    border-color: #475569;
}

.action-card strong,
.action-card small {
    display: block;
}

.action-card strong {
    margin-bottom: 5px;

    font-size: 1rem;
}

.action-card small {
    color: var(--muted);
    line-height: 1.4;
}

.action-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: rgba(250, 204, 21, 0.12);
    color: var(--accent);

    font-size: 1.5rem;
}

.action-card-danger .action-icon {
    background: rgba(185, 28, 28, 0.18);
    color: #fca5a5;
}

.workflow-card {
    width: min(720px, 100%);

    padding: 26px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(23, 32, 51, 0.92);
}

.workflow-card label {
    display: block;

    margin: 20px 0 7px;

    color: #cbd5e1;

    font-size: 0.86rem;
    font-weight: 700;
}

.workflow-card label:first-child {
    margin-top: 0;
}

input {
    width: 100%;

    min-height: 48px;

    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: 9px;

    outline: none;

    background: var(--background-secondary);
    color: var(--text);

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

select,
textarea {
    width: 100%;

    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: 8px;

    outline: none;

    background: var(--background-secondary);
    color: var(--text);

    font: inherit;
}

select {
    min-height: 48px;
}

textarea {
    resize: vertical;
}

select:focus,
textarea:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(250, 204, 21, 0.12);
}

input::placeholder {
    color: #64748b;
}

input:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(250, 204, 21, 0.12);
}

.scan-row {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 8px;
}

.scan-row-three {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.camera-button,
.primary-button {
    min-height: 48px;

    padding: 10px 16px;

    border-radius: 9px;

    font-weight: 750;
}

.camera-button {
    border: 1px solid var(--border);

    background: var(--panel-hover);
    color: var(--text);
}

.primary-button {
    margin-top: 24px;

    border: 1px solid #eab308;

    background: var(--accent);
    color: #111827;
}

.primary-button:hover {
    background: var(--accent-hover);
}

.danger-button {
    min-height: 48px;

    margin-top: 24px;
    padding: 10px 16px;

    border: 1px solid #dc2626;
    border-radius: 8px;

    background: #991b1b;
    color: #fff;

    font-weight: 750;
}

.danger-button:hover {
    background: #b91c1c;
}

.helper-text {
    margin: 15px 0 0;

    color: var(--muted);

    font-size: 0.82rem;
    line-height: 1.5;
}

.sold-tote-helper {
    margin-top: 8px;
}

.empty-state {
    padding: 70px 30px;

    text-align: center;

    border: 1px dashed var(--border);
    border-radius: var(--radius);

    background: rgba(23, 32, 51, 0.45);
}

.empty-state h2 {
    margin: 12px 0 7px;
}

.empty-state p {
    margin: 0;

    color: var(--muted);
}

.empty-icon {
    color: var(--accent);
    font-size: 2.5rem;
}

.app-footer {
    padding: 28px;

    text-align: center;

    border-top: 1px solid var(--border);

    color: #64748b;

    font-size: 0.78rem;
}

.app-footer span {
    margin: 0 6px;
}


/* ---------------------------------------------------------
   Camera barcode scanner
--------------------------------------------------------- */

.scanner-dialog {
    width: min(720px, calc(100% - 32px));
    max-width: none;
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--background-secondary);
    color: var(--text);
}

.scanner-dialog::backdrop {
    background: rgba(2, 6, 23, 0.82);
}

.scanner-heading {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 16px;
    padding-right: 52px;
}

.scanner-heading h2 {
    margin: 2px 0 0;
    font-size: 1.35rem;
}

.scanner-close-button {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;

    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;

    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--panel-hover);
    color: var(--text);

    font-size: 1.6rem;
    line-height: 1;
}

.scanner-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: #000;
}

.scanner-preview video {
    position: relative;
    z-index: 1;

    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.scanner-guide {
    position: absolute;
    z-index: 2;
    top: 35%;
    left: 8%;

    width: 84%;
    height: 30%;

    border: 3px solid rgba(250, 204, 21, 0.9);
    border-radius: 8px;

    box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.28);
    pointer-events: none;
}

.scanner-line {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 8px;
    left: 8px;

    height: 2px;

    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.95);
    transform: translateY(-50%);
}

.scanner-status {
    min-height: 1.5em;
    margin: 14px 0 0;

    color: var(--muted);
    line-height: 1.5;
}

.scanner-status-error {
    color: #fecaca;
}

.scanner-camera-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    margin-top: 14px;
}

.scanner-camera-row label {
    margin: 0;
}

.scanner-camera-row select {
    width: 100%;
}


/* ---------------------------------------------------------
   Tablet
--------------------------------------------------------- */

@media (max-width: 900px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .menu-button {
        display: block;
    }

    .main-navigation {
        position: absolute;

        top: 69px;
        left: 0;
        right: 0;

        display: none;
        flex-direction: column;
        align-items: stretch;

        padding: 12px;

        background: #0b1220;

        border-bottom: 1px solid var(--border);
    }

    .main-navigation.open {
        display: flex;
    }

    .main-navigation button {
        text-align: left;
        padding: 13px;
    }

}


/* ---------------------------------------------------------
   Phone
--------------------------------------------------------- */

@media (max-width: 600px) {

    .app-header {
        padding: 0 16px;
    }

    .app-main {
        width: min(100% - 28px, 1180px);

        padding-top: 34px;
    }

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

    .stat-card {
        min-height: 125px;
        padding: 16px;
    }

    .stat-card strong {
        font-size: 2rem;
    }

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

    .workflow-card {
        padding: 18px;
    }

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

    .scan-row-three {
        grid-template-columns: 1fr;
    }

    .camera-button {
        width: 100%;
    }

    .scanner-dialog {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
        padding: 14px;

        overflow-y: auto;
    }

    .scanner-preview {
        height: min(68dvh, 620px);
        aspect-ratio: 3 / 4;
    }

    .scanner-guide {
        top: 36%;
        left: 6%;
        width: 88%;
        height: 28%;
    }

    .scanner-camera-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

}


/* ---------------------------------------------------------
   Export
--------------------------------------------------------- */

.export-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.export-card {
    width: 100%;
}

.export-card h2 {
    margin: 0 0 16px;
    font-size: 1.05rem;
}

.radio-list {
    display: grid;
    gap: 8px;
}

.choice-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;

    margin: 0 !important;
    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--background-secondary);

    cursor: pointer;
}

.choice-row:hover {
    border-color: #475569;
}

.choice-row input {
    width: auto;
    min-height: auto;

    margin: 3px 0 0;

    accent-color: var(--accent);
}

.choice-row strong,
.choice-row small {
    display: block;
}

.choice-row small {
    margin-top: 3px;

    color: var(--muted);
    line-height: 1.35;
}

.conditional-options {
    margin-top: 20px;
    padding-top: 4px;
}

.hidden {
    display: none !important;
}

.date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 9px;

    margin: 0 !important;
    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--background-secondary);

    cursor: pointer;
}

.check-row input {
    width: auto;
    min-height: auto;
    margin: 0;

    accent-color: var(--accent);
}

.export-format-heading {
    margin-top: 28px !important;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.format-button {
    min-height: 82px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--background-secondary);
    color: var(--text);

    text-align: left;
}

.format-button:hover {
    border-color: #64748b;
}

.format-button.selected {
    border-color: var(--accent);

    box-shadow:
        0 0 0 2px rgba(250, 204, 21, 0.12);
}

.format-button strong,
.format-button small {
    display: block;
}

.format-button small {
    margin-top: 4px;
    color: var(--muted);
}

.export-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;

    margin-top: 20px;
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: rgba(11, 18, 32, 0.6);
}

.export-summary span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.export-button {
    width: 100%;
}


@media (max-width: 900px) {

    .export-layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

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

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

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

}


/* ---------------------------------------------------------
   Authentication
--------------------------------------------------------- */

body.auth-loading .app-header,
body.auth-loading .app-main,
body.auth-loading .app-footer {
    display: none;
}

.auth-gate {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 28px;

    background:
        radial-gradient(
            circle at top,
            #172033 0,
            var(--background) 520px
        );
}

.auth-card {
    width: min(430px, 100%);

    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(23, 32, 51, 0.96);

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.32);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 34px;
}

.auth-brand > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-brand strong {
    font-size: 1.1rem;
}

.auth-brand span:not(.brand-disc) {
    color: var(--muted);
    font-size: 0.78rem;
}

.auth-state h1 {
    margin: 5px 0 8px;

    font-size: 2rem;
}

.auth-state > p:not(.eyebrow):not(.auth-error) {
    color: var(--muted);
    line-height: 1.5;
}

.auth-description {
    margin: 0 0 24px;
}

.auth-state label {
    display: block;

    margin: 18px 0 7px;

    color: #cbd5e1;

    font-size: 0.86rem;
    font-weight: 700;
}

.auth-submit {
    width: 100%;
}

.auth-error {
    margin: 14px 0 0;
    padding: 11px 12px;

    border: 1px solid #7f1d1d;
    border-radius: 8px;

    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;

    font-size: 0.86rem;
    line-height: 1.4;
}

.secondary-button {
    min-height: 48px;

    margin-top: 22px;
    padding: 10px 16px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--panel-hover);
    color: var(--text);

    font-weight: 750;
}

.secondary-button:hover {
    border-color: #64748b;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-left: 16px;
    padding-left: 16px;

    border-left: 1px solid var(--border);
}

.user-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    line-height: 1.2;
}

.user-identity strong {
    font-size: 0.85rem;
}

.user-identity span {
    margin-top: 3px;

    color: var(--muted);

    font-size: 0.7rem;
}

.logout-button {
    padding: 8px 10px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: transparent;
    color: var(--muted);

    font-size: 0.78rem;
}

.logout-button:hover {
    background: var(--panel);
    color: var(--text);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}


/* ---------------------------------------------------------
   Sold inventory workflow
--------------------------------------------------------- */

.workflow-status {
    margin: 1rem 0;
    padding: 0.8rem 0.9rem;

    border: 1px solid currentColor;
    border-radius: 8px;

    font-size: 0.88rem;
    line-height: 1.45;
}

.workflow-status-success {
    color: var(--success);
}

.workflow-status-error {
    color: #fecaca;
}

.workflow-status-info {
    color: #cbd5e1;
}

.sold-details {
    margin-top: 1.25rem;
    padding-top: 1.25rem;

    border-top: 1px solid var(--border);
}

#soldReleaseSummary {
    padding: 0.9rem;

    border-left: 3px solid var(--accent);

    background: rgba(11, 18, 32, 0.55);
}

.sold-release-title,
.sold-release-metadata {
    display: block;
}

.sold-release-metadata {
    margin-top: 0.3rem;

    color: var(--muted);

    font-size: 0.8rem;
    line-height: 1.45;
}


/* ---------------------------------------------------------
   User management
--------------------------------------------------------- */

.user-management-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.45fr);
    gap: 2rem;
    align-items: start;
}

.user-create-card {
    width: 100%;
}

.user-create-card h2,
.panel-heading h2 {
    margin: 0;
}

.user-list-panel {
    min-width: 0;
}

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

    margin-bottom: 1rem;
}

.panel-heading .secondary-button {
    margin-top: 0;
}

.user-list,
.audit-list {
    display: grid;
    gap: 0.75rem;
}

.user-item {
    padding: 1rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: rgba(23, 32, 51, 0.65);
}

.user-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.user-display-name,
.user-account-detail {
    display: block;
}

.user-account-detail {
    margin-top: 0.25rem;

    color: var(--muted);

    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.user-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.user-badge {
    padding: 0.25rem 0.45rem;

    border: 1px solid var(--border);
    border-radius: 6px;

    color: #cbd5e1;

    font-size: 0.68rem;
    font-weight: 750;
}

.user-role-admin {
    border-color: #a16207;
    color: #fde68a;
}

.user-status-active {
    border-color: #166534;
    color: #bbf7d0;
}

.user-status-inactive,
.user-password-pending {
    border-color: #7f1d1d;
    color: #fecaca;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;

    margin-top: 0.9rem;
}

.user-action-button {
    min-height: 38px;
    padding: 0.45rem 0.7rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--panel-hover);
    color: var(--text);

    font-size: 0.76rem;
    font-weight: 700;
}

.user-action-button:hover {
    border-color: #64748b;
}

.user-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.user-action-button:disabled:hover {
    border-color: var(--border);
}

.user-action-danger {
    border-color: #7f1d1d;
    color: #fecaca;
}

.current-account-note,
.user-empty-state {
    margin: 0.75rem 0 0;

    color: var(--muted);

    font-size: 0.8rem;
}

.audit-panel {
    margin-top: 2.5rem;
    padding-top: 2rem;

    border-top: 1px solid var(--border);
}

.audit-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;

    padding: 0.75rem 0;

    border-bottom: 1px solid var(--border);
}

.audit-item p {
    margin: 0;

    font-size: 0.84rem;
    line-height: 1.45;
}

.audit-time {
    flex: 0 0 auto;

    color: var(--muted);

    font-size: 0.72rem;
}

.password-dialog {
    width: min(460px, calc(100% - 2rem));
    padding: 1.5rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--panel);
    color: var(--text);
}

.password-dialog::backdrop {
    background: rgba(3, 7, 18, 0.78);
}

.password-dialog h2 {
    margin: 0 0 0.5rem;
}

.password-dialog > form > p:not(.helper-text) {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.password-dialog label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;

    margin-top: 1.25rem;
}

.dialog-actions .primary-button,
.dialog-actions .secondary-button {
    margin-top: 0;
}

@media (max-width: 900px) {
    .user-management-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .user-item-heading,
    .audit-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-badges {
        justify-content: flex-start;
    }

    .user-action-button {
        flex: 1 1 140px;
    }
}


@media (max-width: 900px) {

    .user-menu {
        margin-left: 10px;
        padding-left: 10px;
    }

    .user-identity {
        display: none;
    }

}


@media (max-width: 600px) {

    .auth-gate {
        padding: 16px;
    }

    .auth-card {
        padding: 22px;
    }

    .logout-button {
        padding: 8px;
    }

}
/* ============================================================
   DVD Inventory - persisted tote list
   ============================================================ */

.tote-status {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid currentColor;
    border-radius: 0.6rem;
}

.tote-status-success {
    opacity: 0.95;
}

.tote-status-error {
    font-weight: 600;
}

.tote-status-info {
    opacity: 0.85;
}

.tote-list-card {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.35));
    border-radius: 0.8rem;
}

.tote-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tote-list-heading h2 {
    margin: 0;
}

.tote-list-heading .secondary-button {
    margin-top: 0;
}

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

.tote-item {
    padding: 1rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, 0.35));
    border-radius: 8px;
}

.tote-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tote-item-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tote-item-description,
.tote-item-location,
.tote-empty-state {
    margin: 0.4rem 0 0;
}

.tote-item-location,
.tote-empty-state {
    opacity: 0.75;
}

.tote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;

    margin-top: 1rem;
}

.tote-action-button {
    min-height: 40px;
    padding: 0.55rem 0.8rem;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--panel-hover);
    color: var(--text);

    font-size: 0.82rem;
    font-weight: 700;
}

.tote-action-button:hover {
    border-color: #64748b;
}

.tote-action-danger {
    border-color: #7f1d1d;
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}

.tote-action-danger:hover {
    border-color: #ef4444;
}

.tote-contents {
    margin-top: 1rem;
    padding-top: 1rem;

    border-top: 1px solid var(--border);

    overflow-x: auto;
}

.tote-contents[hidden] {
    display: none;
}

.tote-contents-table {
    width: 100%;
    border-collapse: collapse;
}

.tote-contents-table th,
.tote-contents-table td {
    padding: 0.7rem 0.65rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.tote-contents-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.tote-contents-table tbody tr:last-child td {
    border-bottom: 0;
}

.tote-quantity-heading,
.tote-quantity {
    width: 6.5rem;
    text-align: right !important;
}

.tote-release-title,
.tote-release-details {
    display: block;
}

.tote-release-details {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.tote-release-edit {
    min-height: 34px;
    margin-top: 0.65rem;
    padding: 0.4rem 0.65rem;
}

.release-editor-dialog {
    width: min(620px, calc(100% - 2rem));
}

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

.release-editor-dialog textarea {
    width: 100%;
}

.tote-contents-empty,
.tote-contents-error {
    margin: 0;
    padding: 0.35rem 0;
    color: var(--muted);
}

.tote-contents-error {
    color: #fecaca;
}

@media (max-width: 640px) {
    .tote-list-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .tote-action-button {
        flex: 1 1 145px;
    }

    .tote-contents-table th,
    .tote-contents-table td {
        padding-right: 0.4rem;
        padding-left: 0.4rem;
    }

    .release-editor-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   Inventory and search results
   ============================================================ */

.inventory-panel {
    border-top: 1px solid var(--border);
}

.inventory-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.inventory-panel-heading .secondary-button {
    margin-top: 0;
}

.inventory-summary,
.inventory-empty-state {
    margin: 0;
    color: var(--muted);
}

.inventory-results {
    border-top: 1px solid var(--border);
}

.inventory-result-header,
.inventory-result-row {
    display: grid;
    grid-template-columns:
        minmax(220px, 2fr)
        minmax(120px, 0.85fr)
        minmax(220px, 1.4fr)
        72px;
    gap: 1rem;
    align-items: start;
}

.inventory-result-header {
    padding: 0.75rem 1rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.inventory-result-row {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.inventory-result-title,
.inventory-result-details,
.inventory-result-upc,
.inventory-location-code,
.inventory-location-detail {
    display: block;
}

.inventory-result-details,
.inventory-result-upc,
.inventory-location-detail {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.inventory-result-upc,
.inventory-location-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.inventory-location + .inventory-location {
    margin-top: 0.65rem;
}

.inventory-result-quantity {
    text-align: right;
    font-size: 1.05rem;
    font-weight: 750;
}

.inventory-empty-state {
    padding: 2rem 1rem;
    text-align: center;
}

.search-controls {
    max-width: none;
}

.search-results {
    margin-top: 1.25rem;
}

@media (max-width: 760px) {
    .inventory-result-header {
        display: none;
    }

    .inventory-result-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.85rem 1rem;
    }

    .inventory-result-upc-cell,
    .inventory-result-locations {
        grid-column: 1 / -1;
    }

    .inventory-result-quantity {
        grid-column: 2;
        grid-row: 1;
    }
}
