:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f8f9fa;
  --line: #e5e8ec;
  --line-dark: #d7dce2;
  --ink: #1d242c;
  --muted: #68727e;
  --soft-muted: #929ba5;
  --green: #13795b;
  --green-bg: #eaf7f1;
  --red: #c9363e;
  --red-bg: #fff0f0;
  --orange: #b65a18;
  --orange-bg: #fff3e8;
  --yellow: #8b6900;
  --yellow-bg: #fff8da;
  --blue: #2769c7;
  --blue-bg: #edf4ff;
  --magenta: #a32d60;
  --magenta-bg: #fff0f6;
  --sidebar: #18221f;
  --shadow: 0 10px 32px rgba(24, 34, 31, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 224px; min-width: 224px; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: var(--sidebar); color: #fff; z-index: 40; }
.brand { height: 68px; padding: 0 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #e85d3f; border-radius: 8px; font-weight: 700; }
.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: #90a09b; font-size: 11px; margin-top: 1px; }
.brand .icon-btn { margin-left: auto; color: #fff; }
nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-label { margin: 14px 10px 6px; color: #71827d; font-size: 10px; font-weight: 600; }
.nav-item { position: relative; width: 100%; height: 38px; border: 0; border-radius: 6px; background: none; color: #aebbb7; display: flex; align-items: center; gap: 10px; padding: 0 11px; margin: 2px 0; font-size: 13px; text-align: left; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { background: #31413c; color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; height: 20px; width: 3px; background: #e85d3f; border-radius: 0 3px 3px 0; }
.nav-item b { margin-left: auto; min-width: 20px; height: 18px; padding: 0 5px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; border-radius: 9px; font-size: 10px; }
.sidebar-footer { margin: 10px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 9px; align-items: center; color: #dfe7e4; font-size: 11px; }
.sidebar-footer small { display: block; color: #71827d; margin-top: 2px; }
.sync-dot { width: 8px; height: 8px; background: #4fd1a1; border-radius: 50%; box-shadow: 0 0 0 4px rgba(79,209,161,.12); }

.main-shell { min-width: 0; flex: 1; }
.topbar { height: 68px; position: sticky; top: 0; z-index: 30; padding: 0 24px; display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.global-search { width: min(500px, 46vw); position: relative; display: flex; align-items: center; }
.global-search > svg { position: absolute; left: 13px; width: 18px; color: var(--muted); }
.global-search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 0 62px 0 40px; background: #f7f8f9; outline: none; font-size: 13px; }
.global-search input:focus { border-color: #6c827a; background: #fff; box-shadow: 0 0 0 3px rgba(19,121,91,.08); }
kbd { position: absolute; right: 9px; border: 1px solid var(--line-dark); background: #fff; color: var(--soft-muted); padding: 2px 5px; border-radius: 4px; font-size: 9px; }
.search-results { display: none; position: absolute; top: 45px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); max-height: 370px; overflow: auto; padding: 6px; }
.search-results.open { display: block; }
.search-result { border: 0; background: #fff; width: 100%; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 8px; border-radius: 5px; text-align: left; }
.search-result:hover { background: var(--panel-soft); }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--muted); margin-top: 3px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.live-indicator { color: var(--red); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--panel-soft); color: var(--ink); }
.icon-btn svg { width: 18px; }
.has-badge { position: relative; }
.has-badge span { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1px solid #fff; }
.role-picker { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-left: 1px solid var(--line); position: relative; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #dceae5; color: var(--green); font-size: 11px; font-weight: 700; }
.role-picker select { appearance: none; border: 0; background: none; padding-right: 20px; font-size: 12px; color: var(--ink); outline: none; cursor: pointer; }
.role-picker > svg { width: 14px; position: absolute; right: 7px; pointer-events: none; }

main { padding: 24px; max-width: 1680px; margin: 0 auto; }
.page-header { min-height: 52px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-header h1 { font-size: 22px; margin: 0 0 5px; line-height: 1.25; }
.page-header p { margin: 0; color: var(--muted); font-size: 12px; }
.header-actions, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn { min-height: 36px; border-radius: 6px; border: 1px solid var(--line-dark); background: #fff; color: var(--ink); padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 500; }
.btn:hover { background: #f6f8f7; border-color: #b8c0c6; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { border-color: var(--green); background: var(--green); color: #fff; }
.btn.primary:hover { background: #0f684d; }
.btn.danger { color: var(--red); border-color: #f0c9cb; }
.btn.small { min-height: 30px; padding: 0 9px; font-size: 11px; }
.btn:disabled, .icon-btn:disabled { opacity: .45; cursor: not-allowed; }

.metric-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 18px; }
.metric { min-width: 0; padding: 16px 17px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label svg { width: 15px; }
.metric strong { display: block; margin-top: 7px; font-size: 24px; line-height: 1; }
.metric small { color: var(--soft-muted); font-size: 10px; }
.metric strong.warn { color: var(--orange); }
.metric strong.danger { color: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.panel-head { min-height: 53px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-title h2 { margin: 0; font-size: 14px; }
.panel-title span { color: var(--muted); font-size: 11px; }
.panel-title svg { width: 17px; color: var(--muted); }
.panel-body { padding: 16px; }
.live-table .product-name { max-width: 180px; }
.table-wrap { overflow: auto; }
.inbound-table-wrap { overflow-x: auto; }
.inbound-table { min-width: 1180px; }
.inbound-table th, .inbound-table td { padding: 8px 7px; }
.inbound-table .input { min-width: 92px; height: 32px; padding: 0 7px; font-size: 11px; }
.inbound-table .ib-name { min-width: 120px; }
.inbound-table .ib-location { min-width: 112px; }
.inbound-table .ib-note { min-width: 120px; }
.row-number { color: var(--soft-muted); font-size: 11px; text-align: center; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
th { height: 40px; padding: 0 12px; background: #fafbfb; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-weight: 500; font-size: 11px; position: sticky; top: 0; z-index: 1; }
td { height: 56px; padding: 8px 12px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.sortable { cursor: pointer; }
.sortable:hover { color: var(--ink); }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.product-cell strong, .product-cell small { display: block; }
.product-cell strong { font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.product-cell small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.thumb { --col: 0; --row: 0; width: 38px; height: 38px; min-width: 38px; border-radius: 5px; background-image: url('assets/blindbox-collection.png'); background-size: 400% 200%; background-position: calc(var(--col) * 33.333%) calc(var(--row) * 100%); background-repeat: no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.thumb.lg { width: 88px; height: 88px; min-width: 88px; border-radius: 7px; }
.qty { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); }
.location-code { font-family: Consolas, monospace; font-weight: 600; color: #3a4a45; }
.status { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 7px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--green); background: var(--green-bg); }
.status.low { color: var(--yellow); background: var(--yellow-bg); }
.status.critical { color: var(--orange); background: var(--orange-bg); }
.status.out { color: var(--red); background: var(--red-bg); }
.status.reserved { color: var(--blue); background: var(--blue-bg); }
.status.abnormal { color: var(--magenta); background: var(--magenta-bg); }
.status.neutral { color: #5c6670; background: #eef1f3; }
.actions { display: flex; gap: 4px; }
.text-btn { border: 0; background: none; color: var(--green); padding: 4px 6px; font-size: 11px; border-radius: 4px; }
.text-btn:hover { background: var(--green-bg); }
.text-btn.danger { color: var(--red); }

.alert-list { padding: 5px 14px; }
.alert-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; min-height: 60px; border-bottom: 1px solid #edf0f2; }
.alert-item:last-child { border: 0; }
.alert-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; }
.alert-icon svg { width: 15px; }
.alert-icon.out { color: var(--red); background: var(--red-bg); }
.alert-icon.low { color: var(--orange); background: var(--orange-bg); }
.alert-icon.abnormal { color: var(--magenta); background: var(--magenta-bg); }
.alert-item strong, .alert-item small { display: block; }
.alert-item strong { font-size: 11px; }
.alert-item small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.task-grid { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px; gap: 8px; }
.task-item { border: 1px solid var(--line); background: #fff; border-radius: 5px; min-height: 64px; padding: 9px; text-align: left; }
.task-item:hover { border-color: #b9c7c2; background: #fafcfb; }
.task-item span { color: var(--muted); font-size: 10px; display: block; }
.task-item strong { display: block; font-size: 19px; margin-top: 3px; }
.activity-list { padding: 5px 14px; }
.activity { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid #edf0f2; }
.activity:last-child { border: 0; }
.activity > i { width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: #a8b3af; }
.activity strong, .activity small { display: block; font-size: 10px; }
.activity strong { font-weight: 500; }
.activity small { color: var(--muted); margin-top: 3px; }
.delta { font-family: Consolas, monospace; font-size: 11px; font-weight: 700; }
.delta.plus { color: var(--green); }
.delta.minus { color: var(--red); }

.toolbar { min-height: 58px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.field-search { position: relative; min-width: 230px; }
.field-search svg { width: 15px; position: absolute; left: 10px; top: 10px; color: var(--muted); }
.field-search input { padding-left: 32px; }
.input, .select, textarea { min-height: 36px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; padding: 0 10px; color: var(--ink); font-size: 12px; outline: none; }
.input:focus, .select:focus, textarea:focus { border-color: #6c827a; box-shadow: 0 0 0 3px rgba(19,121,91,.08); }
.select { min-width: 116px; }
.table-footer { min-height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination { display: flex; gap: 4px; }
.pagination button { width: 29px; height: 29px; border: 1px solid var(--line); background: #fff; border-radius: 4px; font-size: 11px; }
.pagination button.active { background: var(--green); color: #fff; border-color: var(--green); }
.capacity { display: flex; align-items: center; gap: 8px; }
.capacity-bar { width: 74px; height: 5px; border-radius: 3px; background: #edf0f1; overflow: hidden; }
.capacity-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.capacity-bar i.high { background: var(--orange); }

.operation-layout { display: grid; grid-template-columns: minmax(400px, 1.05fr) minmax(330px, .95fr); gap: 18px; align-items: start; }
.form-panel { padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #46514d; font-size: 11px; font-weight: 500; }
.form-group label span { color: var(--muted); font-weight: 400; }
.form-group .input, .form-group .select, .form-group textarea { width: 100%; }
textarea { min-height: 82px; padding-top: 9px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.form-hint { display: flex; gap: 9px; align-items: flex-start; padding: 11px; background: var(--blue-bg); color: #3a5f93; border-radius: 5px; font-size: 10px; line-height: 1.6; margin-bottom: 16px; }
.form-hint svg { width: 15px; min-width: 15px; margin-top: 1px; }
.stock-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stock-preview div { background: var(--panel-soft); padding: 10px; border-radius: 5px; }
.stock-preview span, .stock-preview strong { display: block; }
.stock-preview span { color: var(--muted); font-size: 10px; }
.stock-preview strong { font-size: 18px; margin-top: 3px; }
.scan-box { border: 1px dashed #b8c2be; border-radius: 6px; min-height: 90px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); margin-bottom: 16px; }
.scan-box svg { width: 24px; }
.recent-ops { padding: 4px 14px; }
.recent-op { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent-op:last-child { border: 0; }

.request-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.request-column { background: #eef0f2; border-radius: 6px; min-height: 420px; padding: 10px; }
.request-column-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 2px 10px; font-size: 12px; font-weight: 600; }
.request-column-head span { color: var(--muted); font-size: 10px; background: #fff; padding: 2px 7px; border-radius: 10px; }
.request-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.02); }
.request-card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.priority { font-size: 9px; font-weight: 600; padding: 2px 5px; border-radius: 3px; }
.priority.urgent { color: var(--red); background: var(--red-bg); }
.priority.normal { color: var(--blue); background: var(--blue-bg); }
.request-card h3 { font-size: 12px; margin: 0 0 6px; }
.request-card p { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.request-meta { display: flex; justify-content: space-between; color: var(--soft-muted); font-size: 9px; }
.request-actions { display: flex; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); gap: 5px; }
.box-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; padding: 16px; }
.box-card { border: 1px solid var(--line); border-radius: 7px; padding: 15px; background: #fff; }
.box-card:hover { border-color: #b9c8c1; box-shadow: 0 5px 18px rgba(25,45,36,.06); }
.box-card-head { min-height: 59px; display: flex; justify-content: space-between; gap: 10px; }
.box-card-head h3 { margin: 4px 0 4px; font-size: 15px; }
.box-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.eyebrow { color: var(--green); font-family: Consolas, monospace; font-size: 10px; font-weight: 700; }
.box-count-main { display: flex; align-items: baseline; gap: 7px; margin: 16px 0 10px; }
.box-count-main strong { font-size: 34px; line-height: 1; }
.box-count-main span { color: var(--muted); font-size: 11px; }
.box-count-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.box-count-row b { color: var(--ink); font-size: 12px; margin-left: 3px; }
.box-progress { height: 5px; margin: 12px 0; background: #eef1f0; border-radius: 4px; overflow: hidden; }
.box-progress i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.box-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.box-empty { grid-column: 1 / -1; }
.box-detail-top { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.box-detail-top p { margin: 0 0 8px; font-size: 11px; }
.box-detail-number { display: flex; align-items: baseline; gap: 7px; }
.box-detail-number strong { font-size: 30px; }
.box-detail-number span { color: var(--muted); font-size: 11px; }
.slot-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.slot { min-height: 58px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 5px; background: #fff; text-align: center; }
.slot:hover { border-color: #719286; transform: translateY(-1px); }
.slot strong, .slot small { display: block; }
.slot strong { font-family: Consolas, monospace; font-size: 16px; }
.slot small { margin-top: 4px; font-size: 9px; }
.slot.available { color: var(--green); background: var(--green-bg); border-color: #c4e6d9; }
.slot.locked { color: var(--blue); background: var(--blue-bg); border-color: #cdddf8; }
.slot.opened { color: #6b737a; background: #f0f2f3; }
.style-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.style-columns > section { min-width: 0; }
.section-line { display: flex; align-items: center; justify-content: space-between; }
.section-line .subheading { margin-bottom: 8px; }
.section-line > span { color: var(--muted); font-size: 10px; }
.style-row { min-height: 56px; display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.style-row img, .style-placeholder { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; background: #f0f2f3; display: grid; place-items: center; color: #a2adb3; }
.style-placeholder svg { width: 17px; }
.style-row strong, .style-row small { display: block; }
.style-main { min-width: 0; flex: 1; }
.style-row strong { font-size: 11px; }
.style-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.style-row-actions { display: flex; gap: 1px; }
.style-row-actions .icon-btn { width: 28px; height: 28px; }
.style-upload-preview { margin-top: 10px; }
.display-overlay { display: none; position: fixed; inset: 0; z-index: 120; background: #f3f6f5; color: var(--ink); overflow: auto; }
.display-overlay.open { display: block; }
.display-shell { min-height: 100vh; padding: clamp(22px, 4vw, 54px); }
.display-head { max-width: 1280px; margin: 0 auto; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.display-head h1 { margin: 5px 0 6px; font-size: clamp(24px, 3vw, 40px); }
.display-head p { margin: 0; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); }
.display-close { min-height: 42px; font-size: 13px; }
.display-mode-toggle { display: flex; gap: 6px; margin-left: auto; align-self: end; }
.display-mode-toggle .btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.display-summary { max-width: 1280px; margin: clamp(24px, 4vw, 48px) auto 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.display-summary > div { padding: clamp(18px, 3vw, 30px); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.display-summary strong, .display-summary span { display: block; }
.display-summary strong { font-size: clamp(32px, 5vw, 64px); line-height: 1; color: var(--green); }
.display-summary span { margin-top: 8px; color: var(--muted); font-size: clamp(12px, 1.5vw, 16px); }
.display-content { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.display-numbers, .display-styles { padding: clamp(18px, 2vw, 28px); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.display-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.display-section-head h2 { margin: 0; font-size: clamp(16px, 2vw, 22px); }
.display-section-head span { color: var(--muted); font-size: 11px; }
.display-slot-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.display-slot { min-height: clamp(52px, 6vw, 78px); border-radius: 7px; display: grid; place-items: center; align-content: center; gap: 4px; border: 2px solid transparent; }
.display-slot strong { font-family: Consolas, monospace; font-size: clamp(18px, 2.4vw, 29px); }
.display-slot span { font-size: clamp(11px, 1.3vw, 15px); font-weight: 600; }
.display-slot.available { color: var(--green); background: var(--green-bg); border-color: #bde4d4; }
.display-slot.locked { color: var(--orange); background: var(--orange-bg); border-color: #f2d2b7; }
.display-slot.opened { color: #7d858b; background: #eef1f2; }
.display-style-grid { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.display-style { min-width: min(250px, 72vw); min-height: 240px; padding: 12px; display: flex; flex-direction: column; align-items: stretch; gap: 11px; border: 1px solid var(--line); border-radius: 8px; scroll-snap-align: start; }
.display-style img, .display-style-placeholder { width: 100%; height: 175px; border-radius: 6px; object-fit: cover; background: #eef1f2; display: grid; place-items: center; color: #a5b0b4; }
.display-style-placeholder svg { width: 22px; }
.display-style strong, .display-style span { display: block; }
.display-style strong { font-size: clamp(13px, 1.5vw, 17px); }
.display-style span { color: var(--muted); margin-top: 5px; font-size: 11px; }
.display-style span.has-count { color: var(--green); font-weight: 600; }
.display-no-style { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 12px; }
.display-style-grid.overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
.display-style-grid.overview .display-style { min-width: 0; min-height: 96px; padding: 9px; flex-direction: row; align-items: center; }
.display-style-grid.overview .display-style img, .display-style-grid.overview .display-style-placeholder { width: 72px; height: 72px; flex: 0 0 72px; }
.display-style-grid.overview .display-style span { margin-top: 4px; }

.drawer-backdrop, .modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(20,28,25,.25); z-index: 70; }
.drawer-backdrop.open, .modal-backdrop.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; z-index: 80; width: min(620px, 92vw); height: 100vh; background: #fff; box-shadow: -12px 0 40px rgba(17,25,22,.14); transform: translateX(105%); transition: transform .24s ease; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; z-index: 3; height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { padding: 20px; }
.product-hero { display: flex; gap: 16px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.product-hero h3 { margin: 0 0 6px; font-size: 17px; }
.product-hero p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; border: 1px solid var(--line); border-radius: 6px; }
.detail-metrics div { padding: 12px; border-right: 1px solid var(--line); }
.detail-metrics div:last-child { border: 0; }
.detail-metrics span, .detail-metrics strong { display: block; }
.detail-metrics span { color: var(--muted); font-size: 10px; }
.detail-metrics strong { margin-top: 4px; font-size: 19px; }
.subheading { margin: 20px 0 10px; font-size: 13px; }
.trend { height: 120px; display: flex; align-items: end; gap: 9px; padding: 15px 10px 5px; background: var(--panel-soft); border-radius: 5px; }
.trend-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 5px; }
.trend-col i { width: min(20px, 70%); background: #79a796; border-radius: 3px 3px 0 0; }
.trend-col span { color: var(--soft-muted); font-size: 8px; }

.modal-backdrop { place-items: center; }
.modal-backdrop.open { display: grid; }
.modal { width: min(460px, calc(100vw - 28px)); max-height: 90vh; overflow: auto; background: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.modal-head { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 13px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.danger-callout { padding: 12px; background: var(--red-bg); color: #8e3438; border-radius: 5px; font-size: 11px; line-height: 1.6; }
.source-delete-list { display: grid; gap: 8px; margin-top: 16px; }
.source-delete-list label { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; cursor: pointer; }
.source-delete-list label:hover { border-color: #c0cbc7; background: var(--panel-soft); }
.source-delete-list input { accent-color: var(--red); }
.source-delete-list strong { color: var(--red); font-size: 12px; }
.source-delete-list small { grid-column: 2 / -1; color: var(--muted); font-size: 10px; margin-top: -4px; }

.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: #b4bfc5; }
.empty h3 { margin: 8px 0 4px; color: var(--ink); font-size: 13px; }
.empty p { margin: 0; font-size: 11px; }
.toast-stack { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 380px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; background: #1f2d28; color: #fff; border-radius: 6px; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
.toast svg { width: 17px; color: #71d2ae; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .request-board { grid-template-columns: repeat(2, 1fr); }
  .box-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}
@media (max-width: 860px) {
  .mobile-only { display: grid; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 0 14px; }
  .global-search { width: auto; flex: 1; }
  .live-indicator, .has-badge, kbd { display: none; }
  main { padding: 16px; }
  .operation-layout { grid-template-columns: 1fr; }
  .display-content { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .role-picker select { width: 20px; color: transparent; }
  .role-picker > svg { display: none; }
  .page-header { display: block; }
  .header-actions { margin-top: 12px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .toolbar { display: block; }
  .toolbar .filters { margin-top: 8px; }
  .field-search { width: 100%; }
  .field-search input, .filters .select { width: 100%; }
  .filters .select { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .request-board { grid-template-columns: 1fr; }
  .box-grid { grid-template-columns: 1fr; }
  .style-columns { grid-template-columns: 1fr; }
  .slot-grid { grid-template-columns: repeat(4, 1fr); }
  .request-column { min-height: 120px; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .detail-metrics div:nth-child(2) { border-right: 0; }
  .detail-metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .display-summary { gap: 8px; }
  .display-slot-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .display-head { align-items: center; }
  .display-mode-toggle { width: 100%; margin-left: 0; align-self: auto; }
  .display-mode-toggle .btn { flex: 1; }
  .display-style-grid.overview { grid-template-columns: 1fr; }
}
