:root {
    --bg: #f2f6fb;
    --bg-soft: #f7fafd;
    --panel: #ffffff;
    --panel-alt: #eef4fb;
    --line: #dde6f1;
    --line-strong: #bfcedf;
    --text: #1f2f46;
    --muted: #66758a;
    --muted-strong: #475569;
    --primary: #1f5fbe;
    --primary-soft: #eef5ff;
    --primary-ink: #174b97;
    --brand-navy: #173a67;
    --brand-soft: #edf4ff;
    --brand-line: rgba(31, 95, 190, 0.14);
    --danger: #e11d48;
    --danger-soft: #fff1f2;
    --success: #0f766e;
    --success-soft: #ecfeff;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --shadow: 0 18px 40px rgba(17, 41, 74, 0.12);
    --shadow-soft: 0 8px 18px rgba(17, 41, 74, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f6f8fb;
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

img {
    max-width: 100%;
}

.layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: linear-gradient(180deg, #eef4fb 0%, #f8fbff 100%);
    color: var(--text);
    border-right: 1px solid #d8e3f0;
}

.sidebar-brand {
    margin-bottom: 28px;
}

.sidebar-brand-panel {
    display: grid;
    gap: 16px;
    padding: 18px 16px;
    border: 1px solid var(--brand-line);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(239, 245, 255, 0.96) 100%),
        var(--panel);
    box-shadow: var(--shadow-soft);
}

.sidebar-brand-mark {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 48px;
    width: 100%;
}

.sidebar-brand-mark img {
    display: block;
    width: auto;
    height: 46px;
}

.sidebar-brand-copy {
    display: grid;
    gap: 4px;
}

.sidebar-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-ink);
}

.sidebar-title {
    max-width: 180px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: var(--brand-navy);
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: #3f4a59;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.nav-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

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

.nav-link-text {
    min-width: 0;
    font-weight: 600;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-ink);
    border-color: rgba(31, 95, 190, 0.1);
    box-shadow: inset 0 0 0 1px rgba(31, 95, 190, 0.08);
}

.nav-link.active {
    background: linear-gradient(180deg, #1f5fbe 0%, #174b97 100%);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(31, 95, 190, 0.2);
}

.content {
    min-width: 0;
    padding: 28px 28px 40px;
}

.content-shell {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    margin-bottom: 22px;
    border: 1px solid var(--brand-line);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 246, 255, 0.98) 100%),
        var(--panel);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
}

.topbar-copy {
    display: grid;
    gap: 5px;
}

.topbar-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-ink);
    font-weight: 700;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--brand-navy);
}

.topbar-note {
    color: var(--muted);
    font-size: 13px;
}

.topbar-tools {
    display: grid;
    gap: 8px;
    min-width: min(100%, 520px);
}

.topbar-tool-label {
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.scan-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 520px);
}

.scan-form input {
    max-width: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
    padding: 12px 2px 6px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.page-header p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
}

.page-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-ink);
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.panel {
    min-width: 0;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

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

.section-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-note {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.toolbar,
.toolbar-left,
.filter-actions,
.form-actions,
.import-form,
.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-split {
    justify-content: space-between;
}

.import-form-stacked {
    align-items: stretch;
}

.upload-progress {
    display: grid;
    gap: 8px;
    width: min(520px, 100%);
    margin-top: 8px;
}

.upload-progress.is-hidden {
    display: none;
}

.upload-progress-bar {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbeafe;
}

.upload-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    transition: width 0.2s ease;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.button.primary {
    background: linear-gradient(180deg, #1f5fbe 0%, #174b97 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(31, 95, 190, 0.2);
}

.button.light {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--line);
    color: var(--text);
}

.button.danger {
    background: var(--danger);
    color: #ffffff;
}

.button:hover {
    transform: translateY(-1px);
}

.button.is-disabled,
.button[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.button:focus-visible,
.nav-link:focus-visible,
.filter-chip:focus-visible,
.text-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.text-link {
    color: var(--primary-ink);
    font-weight: 600;
    margin-right: 12px;
}

.table-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 160px;
}

.table-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--primary-ink);
    font-weight: 700;
    white-space: nowrap;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.table-action-link:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-1px);
}

.table-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--primary-ink);
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.table-action-button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-1px);
}

.table-action-button-danger {
    border-color: #fecdd3;
    background: #fff1f2;
    color: var(--danger);
}

.danger-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    background: #fff1f2;
    color: var(--danger);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.danger-action-button:hover {
    border-color: #fda4af;
    background: #ffe4e6;
    transform: translateY(-1px);
}

.text-button {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.danger-text {
    color: var(--danger);
    font-weight: 600;
}

.text-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.notice.success {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    color: var(--primary-ink);
}

.notice.error {
    background: var(--danger-soft);
    border-color: #fecdd3;
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    font: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #ffffff;
    outline: none;
}

.category-picker {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(150px, 1fr);
    gap: 8px;
}

.category-picker select {
    min-width: 0;
}

label span {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
}

.filter-grid,
.form-grid,
.detail-grid,
.stats-grid,
.dashboard-grid {
    display: grid;
    gap: 16px;
}

.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

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

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.full-width {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding-top: 30px;
}

.checkbox-field input {
    width: auto;
}

.checkbox-field span {
    margin: 0;
}

.table-wrap {
    min-width: 0;
    overflow-x: auto;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.stat-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(31, 95, 190, 0.04) 0%, rgba(31, 95, 190, 0) 100%), var(--panel);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-card.warning {
    border-color: #fdba74;
    border-left: 4px solid var(--warning);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.07) 0%, rgba(255, 251, 235, 0.94) 100%);
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.12);
}

.today-focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

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

.sample-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.focus-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(31, 95, 190, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: var(--shadow-soft);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.focus-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: var(--shadow);
}

.focus-card.warning {
    border-color: #fde3bf;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(255, 251, 235, 1) 100%);
}

.focus-card-label {
    font-size: 13px;
    color: var(--muted);
}

.focus-card strong {
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--brand-navy);
}

.focus-card-note {
    color: var(--muted);
    font-size: 13px;
}

.overview-card strong {
    color: var(--primary-ink);
}

.management-card strong {
    font-size: 28px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    font-weight: 600;
}

.filter-chip.active {
    background: var(--primary-soft);
    border-color: #93c5fd;
    color: var(--primary-ink);
}

.status-pill,
.metric-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.warning,
.metric-pill.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-pill.info,
.metric-pill.info {
    background: var(--primary-soft);
    color: var(--primary-ink);
}

.status-pill.success,
.metric-pill.success {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill.danger,
.metric-pill.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill.muted,
.metric-pill.muted {
    background: #f1f5f9;
    color: var(--muted);
}

.showroom-map-toolbar {
    margin-bottom: 18px;
}

.showroom-map-helper {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.showroom-map-search {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
    gap: 12px;
    align-items: end;
}

.map-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    color: var(--muted);
    font-size: 13px;
}

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

.showroom-map-panel {
    overflow: auto;
}

.showroom-map-stage {
    position: relative;
    width: 100%;
    min-width: 760px;
    line-height: 0;
    overflow: hidden;
}

.showroom-map-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.showroom-hotspot-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: transparent;
    display: block;
    overflow: hidden;
}

.showroom-hotspot-svg .map-hotspot {
    cursor: pointer;
    fill: transparent;
    outline: none;
    pointer-events: auto;
    stroke: transparent;
    stroke-dasharray: 0.55 0.35;
    stroke-linejoin: round;
    stroke-width: 0;
    transition: fill 0.15s ease, opacity 0.15s ease, stroke 0.15s ease;
    vector-effect: non-scaling-stroke;
}

.showroom-hotspot-svg .map-hotspot:hover {
    fill: transparent;
    stroke: rgba(37, 99, 235, 0.75);
    stroke-width: 0.28;
}

.showroom-map-stage.show-hotspot-areas .map-hotspot.cabinet {
    fill: rgba(37, 99, 235, 0.18);
    stroke: rgba(37, 99, 235, 0.85);
    stroke-width: 0.25;
}

.showroom-map-stage.show-hotspot-areas .map-hotspot.table {
    fill: rgba(219, 39, 119, 0.18);
    stroke: rgba(219, 39, 119, 0.85);
    stroke-width: 0.25;
}

.showroom-hotspot-svg .map-hotspot.selected {
    fill: transparent;
    stroke: #16a34a;
    stroke-width: 0.35;
}

.showroom-hotspot-svg .map-hotspot.highlighted {
    fill: transparent;
    stroke: #2563eb;
    stroke-width: 0.45;
}

.showroom-hotspot-svg .map-hotspot.warning {
    fill: transparent;
    stroke: #f59e0b;
    stroke-width: 0.35;
}

.showroom-map-stage.show-hotspot-areas .map-hotspot.selected {
    fill: rgba(34, 197, 94, 0.08);
    stroke: #16a34a;
    stroke-width: 0.35;
}

.showroom-hotspot-svg .map-hotspot.is-filtered-out {
    opacity: 0.12;
    pointer-events: none;
}

.showroom-detail-panel {
    position: sticky;
    top: 16px;
    display: grid;
    align-content: start;
    gap: 12px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.showroom-empty-detail {
    color: var(--muted);
    line-height: 1.5;
}

.showroom-empty-detail h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 18px;
}

.showroom-empty-detail p {
    margin: 0 0 10px;
}

.showroom-map-tip {
    margin-top: 14px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.showroom-location-header {
    display: grid;
    gap: 4px;
}

.showroom-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.showroom-shelf-group {
    display: grid;
    gap: 6px;
    padding-top: 2px;
}

.showroom-shelf-title {
    display: flex;
    justify-content: space-between;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.showroom-shelf-empty {
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    background: #ffffff;
}

.showroom-shelf-group small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.location-photo-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.location-photo-title,
.showroom-samples-section-title {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.location-photo {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.location-photo-caption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.location-photo-empty {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #ffffff;
    text-align: center;
}

.location-photo-actions {
    display: flex;
    justify-content: flex-end;
}

.location-photo-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.showroom-sample-list {
    gap: 8px;
}

.showroom-sample-list > .showroom-sample-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 72px;
    padding: 9px 10px;
    border-radius: 8px;
}

.showroom-sample-image {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #ffffff;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

.showroom-sample-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.showroom-sample-info {
    display: grid;
    gap: 2px;
    min-width: 0;
    font-size: 12px;
    line-height: 1.25;
}

.showroom-sample-info > a {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.showroom-sample-info span,
.showroom-sample-info small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.showroom-sample-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.showroom-sample-actions a {
    color: var(--primary);
    text-decoration: none;
}

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 24px;
}

.photo-modal.open {
    display: grid;
}

.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.58);
    cursor: pointer;
}

.photo-modal-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 14px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.photo-modal-image {
    max-width: calc(90vw - 28px);
    max-height: calc(90vh - 76px);
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-close {
    justify-self: end;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    padding: 7px 12px;
}

.inline-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.request-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.request-hero-status {
    display: grid;
    gap: 10px;
}

.request-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.request-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-list {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 12px;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.timeline-content {
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f8fbff;
}

.timeline-title {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
}

.timeline-meta {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.timeline-note {
    color: var(--text);
    font-size: 14px;
}

.collapsible-panel {
    padding: 16px 18px;
}

.collapsible-summary {
    list-style: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-panel .collapsible-summary {
    display: inline-flex;
    margin-bottom: 0;
}

.collapsible-panel[open] .collapsible-summary {
    margin-bottom: 16px;
}

.collapsible-body {
    display: grid;
    gap: 14px;
}

table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    background: transparent;
}

.request-table {
    min-width: 1500px;
}

.request-overview-table {
    min-width: 1080px;
}

.odoo-request-filter {
    min-width: min(100%, 360px);
}

.active-request-filter {
    margin-top: 6px;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
}

.active-request-filter a {
    margin-left: 8px;
    color: #0b63ce;
    font-weight: 850;
    text-decoration: none;
}

.active-request-filter a:hover {
    text-decoration: underline;
}

.request-ledger-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.request-ledger-table .request-col-select {
    width: 42px;
}

.request-ledger-table .request-col-photo {
    width: 76px;
}

.request-ledger-table .request-col-request-model {
    width: 190px;
}

.request-ledger-table .request-col-supplier {
    width: 180px;
}

.request-ledger-table .request-col-qty {
    width: 82px;
}

.request-ledger-table .request-col-color {
    width: 150px;
}

.request-ledger-table .request-col-request-date,
.request-ledger-table .request-col-ready-date {
    width: 104px;
}

.request-ledger-table .request-col-status {
    width: 118px;
}

.request-ledger-table .request-col-actions {
    width: 104px;
}

.request-ledger-table th,
.request-ledger-table td {
    padding: 8px 8px;
    font-size: 12px;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.request-ledger-table tbody tr {
    height: 72px;
}

.request-ledger-table tbody tr:hover td {
    background: #f8fbff;
}

.request-ledger-row {
    cursor: pointer;
}

.request-ledger-table th {
    background: #e9fbfb;
    color: #0f172a;
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.request-ledger-table .checkbox-col {
    width: 36px;
    min-width: 36px;
}

.request-ledger-photo {
    width: 76px;
    min-width: 76px;
}

.request-ledger-thumb,
.request-remark-thumbs img {
    display: block;
    width: 56px;
    height: 48px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.request-ledger-empty {
    display: grid;
    place-items: center;
    width: 56px;
    height: 48px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
}

.request-ledger-table .checkbox-col,
.request-ledger-table .request-ledger-photo,
.request-ledger-table .sticky-request-model,
.request-ledger-table th:nth-child(1),
.request-ledger-table th:nth-child(2),
.request-ledger-table th:nth-child(3) {
    position: sticky;
    background: #ffffff;
    z-index: 3;
}

.request-ledger-table th:nth-child(1),
.request-ledger-table th:nth-child(2),
.request-ledger-table th:nth-child(3) {
    background: #e9fbfb;
    z-index: 5;
}

.request-ledger-table .checkbox-col,
.request-ledger-table th:nth-child(1) {
    left: 0;
}

.request-ledger-table .request-ledger-photo,
.request-ledger-table th:nth-child(2) {
    left: 42px;
}

.request-ledger-table .sticky-request-model,
.request-ledger-table th:nth-child(3) {
    left: 118px;
    box-shadow: 1px 0 0 #dbeafe;
}

.request-model-cell {
    color: var(--text);
}

.request-model-id {
    margin-bottom: 4px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
}

.request-model-models {
    color: #475569;
    font-size: 12px;
    line-height: 1.25;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-ledger-strong {
    color: var(--text);
    font-weight: 750;
}

.request-ledger-number {
    color: var(--text);
    font-weight: 800;
    text-align: center;
}

.request-ledger-color {
    min-width: 0;
    color: #dc2626;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.request-ledger-color-cell {
    color: #475569;
    line-height: 1.45;
}

.request-color-summary,
.request-ledger-color-cell .helper-text {
    display: block;
    margin: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-status-pill {
    display: inline-block;
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid #d6e4f3;
    border-radius: 999px;
    background: #f8fbff;
    color: #12315f;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-remark-images-cell {
    min-width: 0;
}

.request-remark-thumbs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.request-remark-thumbs img {
    width: 28px;
    height: 26px;
}

.request-remark-thumbs span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.request-ledger-table .actions-col {
    position: sticky;
    right: 0;
    width: 104px;
    min-width: 104px;
    background: #ffffff;
    box-shadow: -1px 0 0 #dbeafe;
    z-index: 4;
}

.request-ledger-table th.actions-col {
    background: #e9fbfb;
    z-index: 6;
}

.request-ledger-table .table-action-group {
    gap: 4px;
    justify-content: flex-end;
}

.request-ledger-table .table-action-link {
    padding: 6px 8px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
}

.request-quick-view-button {
    border-color: #d6e4f3;
    background: #ffffff;
}

.request-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    border: 0;
    background: rgba(15, 23, 42, 0.24);
}

.request-drawer-is-open .request-drawer-backdrop {
    display: block;
}

.request-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 85;
    display: flex;
    flex-direction: column;
    width: min(520px, 100vw);
    height: 100vh;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 0.18s ease;
}

.request-drawer.open {
    transform: translateX(0);
}

.request-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.request-drawer-title {
    color: #0f172a;
    font-size: 16px;
    font-weight: 850;
}

.request-drawer-close {
    padding: 7px 10px;
    border: 1px solid #d6e4f3;
    border-radius: 6px;
    background: #ffffff;
    color: #12315f;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.request-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 22px;
}

.request-drawer-summary {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.request-drawer-request-id {
    color: #0f172a;
    font-size: 18px;
    font-weight: 850;
}

.request-drawer-model-line,
.request-drawer-supplier {
    margin-top: 4px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.request-drawer-section {
    padding: 14px 0;
    border-top: 1px solid #e2e8f0;
}

.request-drawer-section h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.request-drawer-field {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}

.request-drawer-field span {
    color: #64748b;
    font-weight: 700;
}

.request-drawer-field strong {
    min-width: 0;
    color: #0f172a;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.request-drawer-field-block {
    display: block;
}

.request-drawer-field-block > span {
    display: block;
    margin-bottom: 6px;
}

.request-drawer-color-lines {
    display: grid;
    gap: 4px;
    line-height: 1.35;
}

.request-drawer-image-row {
    margin-bottom: 12px;
}

.request-drawer-image-button,
.request-drawer-remark-thumb {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid #d6e4f3;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.request-drawer-image {
    display: block;
    width: 74px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}

.request-drawer-image-empty {
    display: grid;
    place-items: center;
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
}

.request-drawer-remark-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.request-drawer-remark-thumb img {
    display: block;
    width: 72px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
}

.request-drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.muted-value {
    color: #94a3b8;
}

.sample-overview-table {
    min-width: 1120px;
}

.waybill-pool-table {
    min-width: 1320px;
}

.asset-code-pool-table {
    min-width: 1180px;
}

.actions-col {
    width: 190px;
    min-width: 190px;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e9eef5;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-soft);
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

tbody tr {
    background: rgba(255, 255, 255, 0.72);
    transition: background-color 0.16s ease;
}

tbody tr:hover {
    background: var(--primary-soft);
}

.checkbox-col {
    width: 44px;
    min-width: 44px;
    text-align: center;
}

.checkbox-col input {
    width: 16px;
    height: 16px;
}

.empty-cell {
    padding: 28px 14px;
    text-align: center;
    color: var(--muted);
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.detail-list dt {
    font-weight: 600;
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
}

.simple-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.simple-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
}

.request-summary-grid,
.sample-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.summary-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 1) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: var(--shadow-soft);
}

.summary-card-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card-value {
    color: var(--brand-navy);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

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

.summary-card-link {
    color: var(--primary-ink);
    font-weight: 700;
}

.recent-action-list {
    display: grid;
    gap: 12px;
}

.recent-action-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
}

.recent-action-title {
    font-weight: 700;
    color: var(--text);
}

.recent-action-meta {
    color: var(--muted);
    font-size: 13px;
}

.barcode-card {
    margin-top: 20px;
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--bg-soft);
    text-align: center;
}

.sample-detail-image-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    text-align: center;
}

.sample-detail-main-image {
    display: block;
    width: 100%;
    max-width: 340px;
    max-height: 380px;
    margin: 0 auto;
    object-fit: contain;
}

.sample-detail-thumbnail {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 8px;
}

.sample-detail-image-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.request-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

.request-image-gallery .small-title {
    flex-basis: 100%;
    margin-bottom: 0;
    font-size: 14px;
}

.request-image-thumb-card {
    display: grid;
    gap: 7px;
    width: 184px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.request-image-thumb {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.request-image-thumb-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.text-action-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-action-button:hover {
    color: var(--brand-navy);
}

.compact-empty {
    width: 100%;
    padding: 12px;
    text-align: left;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 24px;
}

.image-modal.open {
    display: grid;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.62);
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    max-width: 94vw;
    max-height: 94vh;
    padding: 14px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.image-modal-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    justify-self: end;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

body:has(.request-detail-shell) {
    background: #ffffff;
}

body:has(.request-detail-shell) .content {
    background: #ffffff;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body:has(.request-detail-shell) .topbar {
    display: none;
}

.request-detail-shell {
    display: grid;
    gap: 28px;
    max-width: 1320px;
    margin: 0 auto;
    color: #111827;
}

.request-detail-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0 16px;
    border-bottom: 1px solid #f3f4f6;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.request-detail-heading {
    display: grid;
    gap: 8px;
}

.request-detail-heading h1 {
    margin: 0;
    color: #111827;
    font-size: 32px;
    font-weight: 760;
    line-height: 1.12;
    letter-spacing: 0;
}

.request-detail-meta,
.request-status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: #6b7280;
    font-size: 13px;
}

.request-detail-meta span + span::before,
.request-status-line span + span::before {
    content: "";
}

.request-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.request-detail-actions .button {
    min-height: 36px;
    border-radius: 7px;
    box-shadow: none;
}

.request-status-line {
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid #f3f4f6;
}

.request-summary-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #e5e7eb;
}

.request-summary-strip div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    background: #ffffff;
}

.request-summary-strip span {
    color: #6b7280;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.request-summary-strip strong {
    min-width: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.request-summary-strip .status-pill {
    width: fit-content;
}

.request-mini-link {
    color: #1f5fbe;
    font-weight: 700;
}

.request-document-grid {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}

.request-visual-column,
.request-info-column {
    display: grid;
    gap: 28px;
}

.request-product-image {
    position: relative;
    display: grid;
    min-height: 260px;
    place-items: center;
    overflow: hidden;
    background: #ffffff;
}

.request-product-main-image {
    display: block;
    width: 100%;
    max-width: 360px;
    max-height: 320px;
    object-fit: contain;
}

.request-image-overlay {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 8px 11px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}

.request-image-empty {
    color: #9ca3af;
    font-size: 14px;
}

.request-remark-block,
.request-info-section,
.request-status-history {
    display: grid;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid #f3f4f6;
}

.request-section-label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.request-spec-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.request-spec-list div {
    display: grid;
    grid-template-columns: minmax(160px, 0.32fr) minmax(0, 1fr);
    gap: 32px;
    padding: 13px 0;
    border-bottom: 1px solid #f3f4f6;
}

.request-spec-list dt {
    color: #6b7280;
    font-size: 13px;
    font-weight: 620;
}

.request-spec-list dd {
    min-width: 0;
    margin: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 560;
    overflow-wrap: anywhere;
}

.request-note-text {
    color: #111827;
    font-size: 14px;
    line-height: 1.7;
}

.request-status-history {
    padding-bottom: 18px;
}

.request-status-history .collapsible-summary {
    width: fit-content;
}

.transfer-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    place-items: center;
    padding: 24px;
}

.transfer-modal.open {
    display: grid;
}

.transfer-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(17, 24, 39, 0.42);
    cursor: pointer;
}

.transfer-modal-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 20px;
    width: min(720px, 94vw);
    max-height: 92vh;
    overflow: auto;
    padding: 24px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.24);
}

.transfer-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.transfer-modal-header h2 {
    margin: 4px 0 0;
    color: #111827;
    font-size: 22px;
    font-weight: 760;
    letter-spacing: 0;
}

.transfer-modal-close {
    padding: 7px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.label-title {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.label-subtitle {
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}

.inline-form input,
.inline-form select {
    width: auto;
    min-width: 120px;
}

.image-preview-card {
    display: grid;
    gap: 8px;
    align-content: start;
}

.image-preview-card span {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
}

.image-preview-wrapper {
    min-height: 180px;
    padding: 12px;
    border: 2px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.image-preview-wrapper img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.image-preview-wrapper.is-empty {
    justify-content: center;
}

.image-preview-wrapper.warning {
    border-color: #fb7185;
    background: #fff5f6;
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.08);
}

.image-manager-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
}

.image-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.accessory-list {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.accessory-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
}

.accessory-card-main {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.accessory-card-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.accessory-image-frame {
    min-height: 180px;
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessory-image-frame img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.accessory-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sample-image-cell {
    position: relative;
    width: 58px;
    height: 58px;
}

.sample-register-image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: zoom-in;
}

.sample-register-image-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.sample-image-col {
    width: 150px;
    min-width: 150px;
}

.request-image-col {
    width: 150px;
    min-width: 150px;
}

.sample-image-stack {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.sample-image-cell-large {
    width: 88px;
    height: 88px;
}

.sample-thumb {
    width: 58px;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    object-fit: contain;
}

.sample-thumb-large {
    width: 88px;
    height: 88px;
    padding: 6px;
    object-fit: contain;
}

.sample-code-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary-ink);
    font-weight: 700;
    white-space: nowrap;
}

.request-code-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary-ink);
    font-weight: 700;
    white-space: nowrap;
}

.sample-image-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    background: #f8fafc;
    color: var(--muted);
    font-weight: 600;
}

.sample-image-note {
    border-style: solid;
    border-color: #d6e4f3;
    background: #f6f9fd;
    color: var(--primary-ink);
    text-align: center;
    line-height: 1.4;
}

.sample-image-popover {
    display: none;
    position: absolute;
    top: 0;
    left: 72px;
    width: 220px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow);
    z-index: 20;
}

.sample-image-popover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
}

.sample-image-cell-large .sample-image-popover {
    left: 102px;
}

.sample-image-cell:hover .sample-image-popover {
    display: block;
}

.sample-main-cell {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.sample-main-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.sample-main-subtitle {
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 600;
}

.sample-main-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 13px;
}

.request-main-cell {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.request-main-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.request-main-subtitle {
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 600;
}

.request-main-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 13px;
}

.request-follow-up {
    display: grid;
    gap: 10px;
    min-width: 170px;
    align-content: start;
}

.request-waybill-panel {
    display: grid;
    gap: 14px;
}

.request-follow-up-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.request-logistics {
    display: grid;
    gap: 10px;
    min-width: 190px;
}

.request-logistics-primary {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
}

.request-logistics-primary span {
    color: var(--muted);
    font-size: 12px;
}

.request-logistics-primary strong {
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.request-logistics-list {
    display: grid;
    gap: 6px;
    color: var(--muted-strong);
    font-size: 13px;
}

.sample-metrics {
    display: grid;
    gap: 10px;
    min-width: 170px;
}

.sample-metric-primary {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbff;
}

.sample-metric-primary span {
    color: var(--muted);
    font-size: 12px;
}

.sample-metric-primary strong {
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.sample-metric-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sample-status-stack {
    display: grid;
    gap: 10px;
    align-content: start;
}

.sample-detail-visual {
    margin-bottom: 18px;
}

.sample-detail-image-frame {
    width: 100%;
    min-height: 260px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    color: inherit;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-detail-image-frame img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.helper-text {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.image-helper-note {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #d6e4f3;
    border-radius: 12px;
    background: #f6f9fd;
    color: var(--primary-ink);
    font-size: 13px;
}

.form-group-title {
    margin: 4px 0 -2px;
    padding-top: 10px;
    border-top: 1px solid #e7edf5;
    color: var(--brand-navy);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.muted-text {
    color: var(--muted);
}

.color-requirement-field {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.color-mode-select {
    max-width: 360px;
}

.color-breakdown-field {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.color-breakdown-field[hidden] {
    display: none;
}

.color-breakdown-table {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.color-breakdown-header,
.color-breakdown-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.color-breakdown-header {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.color-breakdown-qty,
.color-breakdown-desc {
    min-width: 0;
}

.color-breakdown-remove {
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #d6e4f3;
    border-radius: 7px;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.color-breakdown-remove:hover {
    border-color: #bfdbfe;
    color: var(--primary-ink);
    background: #f8fbff;
}

.color-breakdown-add {
    justify-self: start;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.request-product-picker {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.request-product-filter {
    display: grid;
    gap: 7px;
}

.request-product-filter label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.request-product-filter-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.request-product-filter-control .button {
    min-height: 42px;
    border-radius: 8px;
}

.request-product-status {
    color: var(--muted);
    font-size: 13px;
}

.request-product-results {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.request-product-row {
    display: grid;
    grid-template-columns: 28px 104px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 124px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.request-product-row[hidden] {
    display: none !important;
}

.request-product-row:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.request-product-row:has(input:checked) {
    border-color: var(--primary);
    background: #eff6ff;
}

.request-product-thumb {
    display: grid;
    place-items: center;
    width: 104px;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #ffffff;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.request-product-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.request-product-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.request-product-meta strong,
.request-product-meta span,
.request-product-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-product-meta strong {
    color: var(--text);
    font-size: 14px;
}

.request-product-meta span {
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
}

.request-product-meta small {
    color: var(--muted);
    font-size: 12px;
}

.request-product-empty {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    text-align: center;
}

.color-breakdown-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.color-breakdown-total {
    padding: 6px 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--primary-ink);
    font-size: 13px;
    font-weight: 800;
}

.color-breakdown-help {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.color-breakdown-display {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.color-mode-chip {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border: 1px solid #d6e4f3;
    border-radius: 999px;
    background: #f6f9fd;
    color: var(--primary-ink);
    font-size: 12px;
    font-weight: 800;
}

.ellipsis {
    max-width: 220px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wrap-text {
    overflow-wrap: anywhere;
}

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

    .sidebar {
        position: static;
        height: auto;
        padding-bottom: 10px;
    }

    .sidebar-brand {
        margin-bottom: 18px;
    }

    .sidebar-title {
        max-width: none;
    }

    .sidebar-brand-panel {
        padding: 16px 14px;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .content {
        padding: 18px;
    }

    .topbar,
    .page-header,
    .request-hero,
    .image-editor-header {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-tool-label {
        text-align: left;
    }

    .topbar-tools {
        min-width: 0;
    }

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

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

    .showroom-map-layout,
    .showroom-map-search {
        grid-template-columns: 1fr;
    }

    .showroom-detail-panel {
        position: static;
    }

    .scan-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

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

    .accessory-card-main {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 640px) {
    .color-breakdown-header {
        display: none;
    }

    .color-breakdown-row {
        grid-template-columns: 1fr;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #f8fafc;
    }

    .color-breakdown-remove {
        justify-self: start;
    }

    .color-breakdown-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Pagination Styles */
.pagination-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid var(--line);
    margin-top: 20px;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination-info strong {
    font-weight: 600;
    color: var(--text);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.16s ease;
}

.pagination-btn:hover:not(.is-disabled) {
    border-color: #1f5fbe;
    color: #1f5fbe;
    background: rgba(31, 95, 190, 0.05);
    transform: translateY(-1px);
}

.pagination-btn.is-disabled,
.pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-page-size {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

.pagination-page-size strong {
    font-weight: 600;
    color: var(--text);
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.pagination-size-selector label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-size-selector select {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    min-width: 70px;
}

.pagination-size-selector select:focus {
    outline: none;
    border-color: #1f5fbe;
}

/* Lightweight office UI refresh */
:root {
    --shadow: 0 8px 18px rgba(17, 41, 74, 0.08);
    --shadow-soft: 0 2px 8px rgba(17, 41, 74, 0.06);
}

.sidebar {
    padding: 18px 14px;
    background: #f8fafc;
}

.sidebar-brand-panel,
.topbar,
.panel,
.summary-card,
.stat-card,
.focus-card {
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.sidebar-brand-panel {
    padding: 14px;
}

.sidebar-title {
    font-size: 16px;
}

.nav-link {
    min-height: 40px;
    border-radius: 8px;
}

.nav-link.active {
    background: #1f5fbe;
    box-shadow: none;
}

.content {
    padding: 20px 22px 32px;
}

.topbar {
    padding: 14px 16px;
    margin-bottom: 16px;
}

.topbar-title {
    font-size: 16px;
}

.topbar-note {
    display: none;
}

.page-header {
    margin-bottom: 14px;
    padding: 6px 0;
}

.page-header-compact h1 {
    margin-bottom: 4px;
}

.page-header h1 {
    font-size: 28px;
    letter-spacing: 0;
}

.page-kicker {
    margin-bottom: 6px;
    letter-spacing: 0.08em;
}

.panel {
    margin-bottom: 14px;
    padding: 16px;
}

.panel-header {
    margin-bottom: 10px;
}

.section-title {
    font-size: 16px;
}

.section-note {
    font-size: 13px;
}

.button {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
}

.button.primary {
    background: #1f5fbe;
    box-shadow: none;
}

.button.light {
    background: #ffffff;
}

.button:hover,
.table-action-link:hover,
.table-action-button:hover,
.focus-card:hover,
.stat-card:hover {
    transform: none;
}

input,
select,
textarea {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
}

label span {
    margin-bottom: 5px;
    font-size: 12px;
}

.worktable-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1.45fr) repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.worktable-filter .search-field {
    min-width: 260px;
}

.worktable-filter .filter-actions {
    align-self: end;
}

.filter-actions-primary,
.secondary-actions {
    grid-column: auto;
}

.secondary-actions {
    justify-content: flex-end;
}

.worktable-panel {
    padding: 0;
    overflow: hidden;
}

.worktable-panel .table-wrap {
    border: 0;
    border-radius: 0;
}

.quick-actions-grid,
.records-grid,
.action-forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.quick-action-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.quick-action-card.primary-action {
    border-color: #93c5fd;
    background: #eff6ff;
}

.quick-action-card strong {
    font-size: 15px;
}

.quick-action-card span {
    color: var(--muted);
    font-size: 13px;
}

table {
    min-width: 980px;
}

th,
td {
    padding: 10px 12px;
    font-size: 13px;
}

th {
    background: #f8fafc;
    letter-spacing: 0.03em;
}

.sample-overview-table {
    min-width: 1180px;
}

.sample-image-col,
.request-image-col {
    width: 118px;
    min-width: 118px;
}

.sample-image-cell,
.sample-thumb {
    width: 56px;
    height: 56px;
}

.sample-image-cell-large,
.sample-thumb-large,
.sample-image-empty {
    width: 64px;
    height: 64px;
}

.sample-image-popover {
    display: none !important;
}

.sample-code-pill,
.request-code-pill {
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.table-primary-cell,
.qty-cell {
    display: grid;
    gap: 4px;
}

.table-primary-cell span,
.qty-cell span {
    color: var(--muted);
    font-size: 12px;
}

.qty-cell strong {
    font-size: 18px;
}

.table-action-group {
    gap: 6px;
    min-width: 150px;
}

.table-action-link,
.table-action-button {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.status-pill,
.metric-pill {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.compact-status-stack {
    gap: 6px;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.form-details {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.form-details summary {
    cursor: pointer;
    font-weight: 700;
}

.form-details[open] summary {
    margin-bottom: 12px;
}

.image-preview-wrapper {
    min-height: 140px;
    border-radius: 8px;
}

.sample-detail-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.compact-sample-header {
    margin-bottom: 16px;
    padding: 0 2px;
}

.sample-detail-page {
    display: grid;
    gap: 14px;
}

.sample-detail-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.96fr);
    gap: 14px;
    align-items: stretch;
}

.sample-side-panel {
    align-self: start;
}

.sample-media-panel {
    align-self: stretch;
}

.sample-media-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(220px, 0.78fr);
    gap: 18px;
    align-items: start;
}

.compact-detail-visual .sample-detail-image-frame {
    min-height: 180px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    text-decoration: none;
}

.compact-detail-visual .sample-detail-image-frame img {
    max-height: 280px;
}

.compact-detail-list {
    gap: 8px;
}

.compact-detail-list div {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 8px;
}

.compact-barcode-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-top: 0;
}

.compact-barcode-card img {
    max-width: 180px;
}

.quantity-location-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.38fr);
    gap: 18px;
    align-items: stretch;
}

.quantity-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 10px;
}

.quantity-card {
    display: grid;
    gap: 8px;
    min-height: 78px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.quantity-card span {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
}

.quantity-card strong {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}

.quantity-card.blue {
    background: #eff6ff;
}

.quantity-card.green {
    background: #ecfdf5;
}

.quantity-card.amber {
    background: #fffbeb;
}

.quantity-card.purple {
    background: #f5f3ff;
}

.quantity-card.red {
    background: #fff1f2;
}

.quantity-card.neutral {
    background: #f8fafc;
}

.location-summary {
    display: grid;
    align-content: center;
    min-height: 78px;
}

.location-empty {
    display: grid;
    place-items: center;
    min-height: 86px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted-strong);
    text-align: center;
}

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

.notes-grid > div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.notes-grid span,
.small-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.notes-grid strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.wide-note {
    grid-column: 1 / -1;
}

.accessory-image-block {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.accessory-frame {
    min-height: 140px;
    padding: 10px;
    border-radius: 8px;
}

.accessory-frame img {
    max-height: 180px;
}

.soft-empty {
    padding: 18px 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.record-tabs > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.record-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.record-tab-list label {
    margin-bottom: -1px;
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.record-tab-panel {
    display: none;
}

#record-tab-freight:checked ~ .record-tab-list label[for="record-tab-freight"],
#record-tab-borrow:checked ~ .record-tab-list label[for="record-tab-borrow"],
#record-tab-damage:checked ~ .record-tab-list label[for="record-tab-damage"],
#record-tab-scrap:checked ~ .record-tab-list label[for="record-tab-scrap"],
#record-tab-recent:checked ~ .record-tab-list label[for="record-tab-recent"] {
    border-color: var(--primary);
    color: var(--primary-ink);
}

#record-tab-freight:checked ~ .freight-panel,
#record-tab-borrow:checked ~ .borrow-panel,
#record-tab-damage:checked ~ .damage-panel,
#record-tab-scrap:checked ~ .scrap-panel,
#record-tab-recent:checked ~ .recent-panel {
    display: block;
}

.record-link {
    display: inline-flex;
    margin-top: 12px;
    color: var(--primary-ink);
    font-weight: 800;
}

.action-drawer,
.danger-drawer {
    padding: 14px;
}

.action-drawer summary,
.danger-drawer summary {
    width: fit-content;
}

.danger-note {
    margin: 12px 0;
    color: #991b1b;
    font-size: 13px;
}

.records-grid {
    align-items: start;
}

.records-grid h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

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

    .filter-actions-primary,
    .secondary-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .worktable-filter,
    .sample-detail-layout {
        grid-template-columns: 1fr;
    }

    .sample-detail-top-grid,
    .sample-media-grid,
    .quantity-location-layout {
        grid-template-columns: 1fr;
    }

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

.freight-bind-page {
    display: grid;
    gap: 16px;
}

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

.freight-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.freight-summary-grid > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.freight-summary-grid span,
.bind-target-meta span,
.selected-target-card span {
    color: var(--muted);
    font-size: 12px;
}

.freight-mini {
    color: #1d4ed8 !important;
    font-weight: 700;
}

.segmented-control,
.bind-type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segment,
.bind-type-tab {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.segment.active,
.bind-type-tab.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.freight-bind-form,
.freight-split-form {
    display: grid;
    gap: 14px;
}

.freight-search-row,
.split-editor-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: end;
}

.split-editor-row {
    grid-template-columns: 160px auto 190px minmax(240px, 1fr) auto auto;
}

.bind-target-grid {
    display: grid;
    gap: 6px;
}

.bind-target-row,
.selected-target-card {
    display: grid;
    grid-template-columns: 28px 52px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.bind-target-row:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.bind-target-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.selected-target-card {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 12px;
}

.selected-target-card.is-selected {
    border-color: #93c5fd;
    background: #eff6ff;
}

.target-thumb,
.target-thumb-empty {
    width: 64px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.target-thumb.compact,
.target-thumb-empty.compact {
    width: 44px;
    height: 44px;
}

.target-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.target-thumb-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.bind-target-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.bind-target-main p,
.selected-target-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.bind-target-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.selected-target-preview {
    display: grid;
    gap: 8px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .freight-search-row,
    .split-editor-row,
    .bind-target-row {
        grid-template-columns: 1fr;
    }

    .bind-target-row,
    .selected-target-card {
        align-items: start;
    }
}

.warehouse-samples-header {
    align-items: flex-start;
}

.warehouse-view-toggle {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.warehouse-view-toggle button {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
}

.warehouse-view-toggle button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.warehouse-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.warehouse-stat-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17, 38, 68, 0.04);
    color: var(--text);
    text-decoration: none;
}

.warehouse-stat-card.active {
    border-color: var(--primary);
    background: #eaf2ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 201, 0.1);
}

.warehouse-stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.warehouse-stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.warehouse-filter-form {
    display: grid;
    grid-template-columns: 1.35fr 1fr 0.72fr 0.72fr 0.72fr 1fr 0.65fr auto;
    gap: 14px;
    align-items: end;
}

.warehouse-filter-actions {
    display: flex;
    gap: 8px;
}

.warehouse-filter-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.warehouse-filter-hint strong {
    color: var(--text);
}

.warehouse-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.warehouse-sample-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(17, 38, 68, 0.07);
}

.warehouse-image-button {
    display: block;
    width: 100%;
    height: 190px;
    padding: 0;
    border: 0;
    background: #eef4fb;
    cursor: zoom-in;
}

.warehouse-image-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.warehouse-no-image {
    display: grid;
    place-items: center;
    min-height: 100%;
    background:
        linear-gradient(135deg, rgba(37, 99, 201, 0.08), rgba(0, 143, 121, 0.08)),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(60, 86, 120, 0.05) 10px, rgba(60, 86, 120, 0.05) 20px);
    color: #7b8da6;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: center;
}

.warehouse-card-body {
    padding: 14px;
}

.warehouse-card-top,
.warehouse-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.warehouse-card-top {
    margin-bottom: 10px;
}

.warehouse-card-footer {
    padding-top: 12px;
    border-top: 1px solid #eef3f9;
}

.warehouse-card-footer .warehouse-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
}

.warehouse-card-footer .warehouse-actions a {
    min-width: 0;
    text-align: center;
}

.warehouse-code {
    color: var(--primary);
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
}

.warehouse-location-pill,
.warehouse-storage-pill {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.warehouse-location-pill {
    background: #eaf2ff;
    color: var(--primary);
}

.warehouse-location-pill.loose-rack {
    background: #e7fbf7;
    color: #008f79;
}

.warehouse-location-pill.unassigned {
    background: #fff4df;
    color: #a66300;
}

.warehouse-model {
    min-height: 48px;
}

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

.warehouse-model span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.warehouse-meta {
    display: grid;
    gap: 7px;
    margin: 12px 0;
    color: #40556f;
    font-size: 13px;
}

.warehouse-meta div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.warehouse-storage-pill {
    background: #f5f8fd;
    color: #445b78;
}

.warehouse-actions {
    display: flex;
    gap: 6px;
}

.warehouse-actions a {
    border: 1px solid #bdd3f4;
    border-radius: 8px;
    background: #f7fbff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    padding: 7px 9px;
    text-decoration: none;
}

.warehouse-table-panel {
    display: none;
}

.warehouse-table-thumb,
.warehouse-table-no-image {
    width: 70px;
    height: 70px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #eef4fb;
    object-fit: contain;
}

.warehouse-table-no-image {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

.warehouse-empty-state {
    grid-column: 1 / -1;
}

.warehouse-scan-summary {
    margin-bottom: 18px;
}

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

.warehouse-summary-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fbff;
}

.warehouse-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.warehouse-summary-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
}

.warehouse-box-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.warehouse-box-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.warehouse-box-group h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.warehouse-box-group ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.warehouse-box-group li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #40556f;
    font-size: 13px;
}

.warehouse-image-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(5, 17, 34, 0.72);
}

.warehouse-image-modal.open {
    display: flex;
}

.warehouse-image-modal-card {
    display: grid;
    grid-template-columns: minmax(320px, 760px) 330px;
    width: min(1140px, 96vw);
    max-height: 90vh;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.warehouse-modal-image-wrap {
    display: grid;
    place-items: center;
    min-height: 520px;
    background: #eef4fb;
}

.warehouse-modal-image-wrap img {
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
}

.warehouse-modal-side {
    padding: 24px;
    border-left: 1px solid var(--line);
}

.warehouse-modal-side h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.warehouse-modal-side dl {
    display: grid;
    gap: 13px;
    margin: 24px 0;
}

.warehouse-modal-side dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.warehouse-modal-side dd {
    margin: 4px 0 0;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .warehouse-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .warehouse-stat-grid,
    .warehouse-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-filter-hint,
    .warehouse-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .warehouse-image-modal-card {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .warehouse-modal-image-wrap {
        min-height: 360px;
    }
}
