:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --text: #18202a;
  --muted: #66717f;
  --line: #dfe5ea;
  --line-strong: #cfd7de;
  --primary: #1f5d50;
  --primary-hover: #184b41;
  --primary-soft: #e7f2ef;
  --danger: #a53c45;
  --danger-soft: #fae9eb;
  --warning: #936315;
  --warning-soft: #fff4d8;
  --success: #246a50;
  --success-soft: #e5f4ed;
  --sidebar: #17212a;
  --sidebar-soft: #22303b;
  --shadow: 0 8px 24px rgba(21, 31, 40, .07);
  --radius: 14px;
  --sidebar-width: 250px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
code, .mono, pre { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .16s ease;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-width: 0;
  height: 100vh;
  padding: 22px 16px;
  overflow: visible;
  color: #f5f8fa;
  background: var(--sidebar);
}
.sidebar-scroll {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 24px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
  font-size: 22px;
  font-weight: 800;
}
.brand-copy strong { display: block; font-size: 16px; }
.brand-copy > span { display: block; margin-top: 2px; color: #9fb0bd; font-size: 11px; }
.nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 9px;
  color: #bdc9d2;
  font-size: 14px;
  text-decoration: none;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
  box-shadow: inset 3px 0 0 #65a994;
}
.nav-icon { width: 20px; text-align: center; font-size: 17px; }
.sidebar-bottom { width: 100%; min-width: 0; margin-top: auto; }

.sidebar-collapse-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 44px;
  padding: 0;
  transform: translate(50%, -50%);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  cursor: pointer;
  color: #d9e3e9;
  background: #22303b;
  box-shadow: 0 5px 16px rgba(0,0,0,.18);
}
.sidebar-collapse-button:hover { color: #fff; background: #2a3b48; }
.sidebar-collapse-icon {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(135deg);
  transition: transform .16s ease;
}

.main-content { min-width: 0; padding: 24px 28px 36px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.topbar p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card.flush { overflow: hidden; }
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 14px;
}
.card-heading h2 { margin: 3px 0 0; font-size: 18px; }
.section-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.break-all { overflow-wrap: anywhere; word-break: break-word; }
.success-text { color: var(--success); }
.danger-text { color: var(--danger); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 18px;
}
.stat-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card > span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin: 7px 0 4px; font-size: 29px; line-height: 1; }
.stat-card strong.text-value { font-size: 20px; }
.stat-card small { display: block; overflow: hidden; color: #8a949f; text-overflow: ellipsis; white-space: nowrap; }

.table-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  color: var(--muted);
  background: #f7f9fa;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
.row-meta {
  display: block;
  max-width: 390px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions form { margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #53606b;
  background: #edf1f3;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.warning,
.badge.status-moderation { color: var(--warning); background: var(--warning-soft); }
.badge.status-active { color: var(--success); background: var(--success-soft); }
.badge.status-banned { color: var(--danger); background: var(--danger-soft); }
.badge.status-archive { color: #52606b; background: #edf1f3; }
.badge.status-queued,
.badge.status-running { color: var(--warning); background: var(--warning-soft); }
.badge.status-completed { color: var(--success); background: var(--success-soft); }
.badge.status-failed,
.badge.status-cancelled { color: var(--danger); background: var(--danger-soft); }
.badge.neutral { color: #52606b; background: #edf1f3; }

button:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.shzn-active-run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 17px 20px;
  border-color: #b9d2ca;
  background: linear-gradient(135deg, #fff, var(--primary-soft));
}
.shzn-active-run strong { display: block; margin-top: 5px; font-size: 14px; }
.shzn-history-heading { align-items: end; }
.shzn-status-filter label { min-width: 155px; }
.shzn-status-filter select,
.shzn-status-filter button { min-height: 34px; }
.shzn-runs-table .number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.shzn-runs-table td:nth-child(3) { min-width: 230px; }
.empty-state { padding: 38px 20px; color: var(--muted); text-align: center; }
.shzn-table-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.shzn-table-footer .pagination { margin: 0; }

.button, button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.button:hover, button:hover { background: var(--primary-hover); }
.button.secondary { color: var(--text); background: #f5f7f8; border-color: var(--line-strong); }
.button.secondary:hover, .button.ghost:hover { background: #edf1f3; }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button.full { width: 100%; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.button.danger-button { color: var(--danger); background: var(--danger-soft); border-color: #efc8cd; }
.button.danger-button:hover { color: #fff; background: var(--danger); }
.text-link { color: var(--primary); font-size: 12px; font-weight: 700; text-decoration: none; }

.logout-button { color: #c6d1d8; border-color: rgba(255,255,255,.15); }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.06); }

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 15px;
}
.filters { display: flex; align-items: end; gap: 10px; }
.filters label { min-width: 145px; }
.parts-filters label { min-width: 230px; }
label { color: #3f4b56; font-size: 11px; font-weight: 700; }
label input, label select { margin-top: 6px; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #fff;
}
input, select { min-height: 38px; }
textarea { resize: vertical; }
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2366717f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input:focus, select:focus, textarea:focus { border-color: #5e9d8b; box-shadow: 0 0 0 3px rgba(31,93,80,.10); }
.result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.result-count strong { color: var(--text); }

.catalog-filter-card { margin-bottom: 18px; padding: 14px; }
.catalog-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(125px, 1fr));
  align-items: end;
  gap: 10px;
}
.catalog-filters label { min-width: 0; }
.catalog-search { grid-column: span 2; }
.catalog-filters input,
.catalog-filters select { min-height: 35px; padding-top: 7px; padding-bottom: 7px; font-size: 12px; }
.range-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.range-filter legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: #3f4b56;
  font-size: 11px;
  font-weight: 700;
}
.range-filter span { color: var(--muted); font-size: 11px; }
.catalog-filter-actions { display: flex; gap: 7px; }
.catalog-filter-actions .button,
.catalog-filter-actions button { min-height: 35px; padding: 7px 11px; white-space: nowrap; }
.catalog-filter-summary {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.catalog-filter-summary strong { color: var(--text); font-size: 12px; }

.price-cell { min-width: 170px; }
.price-editor { display: inline-flex; align-items: center; min-height: 30px; }
.price-display {
  min-height: 0;
  padding: 3px 1px;
  border: 0;
  border-bottom: 1px dashed transparent;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price-display:hover {
  color: var(--primary);
  border-bottom-color: #8aa99f;
  background: transparent;
}
.price-edit-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.price-edit-controls[hidden],
.price-display[hidden] { display: none; }
.price-input-wrap {
  display: inline-flex;
  align-items: center;
  width: 94px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
.price-input-wrap:focus-within {
  border-color: #5e9d8b;
  box-shadow: 0 0 0 2px rgba(31,93,80,.10);
}
.price-input-wrap input {
  width: 70px;
  min-height: 32px;
  padding: 4px 3px 4px 7px;
  border: 0;
  box-shadow: none;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price-input-wrap input:focus { border: 0; box-shadow: none; }
.price-input-wrap span { padding-right: 7px; color: var(--muted); font-size: 10px; }
.price-action {
  width: 27px;
  min-height: 27px;
  padding: 0;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
}
.price-action.cancel { color: var(--muted); border-color: var(--line); background: #fff; }
.price-action.cancel:hover { color: var(--danger); border-color: #e2b7bc; background: var(--danger-soft); }
.price-action.confirm { color: #fff; background: var(--primary); }
.price-editor.is-saving { opacity: .65; pointer-events: none; }
.price-editor.is-saved .price-display { color: var(--primary); }
.price-editor.has-error .price-input-wrap { border-color: #ca5964; background: var(--danger-soft); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.parts-split-workspace {
  display: flex;
  align-items: flex-start;
  width: 100%;
  overflow: visible;
}
.parts-list-pane {
  display: block;
  flex: 1 1 auto;
  min-width: 380px;
  margin: 0;
  overflow: visible;
}
.parts-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.part-row:hover { background: #f7faf9; }
.part-row.selected-row { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
.part-number-column,
.part-number { width: 42px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.part-inspector-column,
.part-inspector-action { width: 48px; padding-left: 6px; padding-right: 10px; text-align: right; }
.part-inspector-open {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 15px;
}
.part-inspector-open:hover,
.part-row.selected-row .part-inspector-open {
  color: var(--primary);
  border-color: #9ebdb4;
  background: var(--primary-soft);
}
.sortable-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}
.sortable-heading:hover,
.sortable-heading.active { color: var(--primary); }
.sort-indicator {
  color: #9ba6ae;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
.sortable-heading.active .sort-indicator { color: var(--primary); }

.part-inspector-splitter {
  position: sticky;
  top: 20px;
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: calc(100vh - 40px);
  cursor: ew-resize;
  touch-action: none;
  outline: none;
  background: transparent;
}
.part-inspector-splitter[hidden] { display: none; }
.part-inspector-splitter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--line-strong);
}
.part-inspector-splitter span {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 12px;
  height: 68px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(21,31,40,.08);
}
.part-inspector-splitter span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 2px;
  height: 26px;
  border-left: 1px solid #94a0aa;
  border-right: 1px solid #94a0aa;
  transform: translateY(-50%);
}
.part-inspector-splitter:hover span,
.part-inspector-splitter:focus-visible span,
.parts-split-workspace.is-resizing .part-inspector-splitter span {
  border-color: #75a99c;
  background: var(--primary-soft);
}
.parts-split-workspace.is-resizing,
.parts-split-workspace.is-resizing * { cursor: ew-resize !important; user-select: none !important; }

.part-inspector-pane {
  position: sticky;
  top: 20px;
  flex: 0 0 var(--part-inspector-width, 430px);
  width: var(--part-inspector-width, 430px);
  height: calc(100vh - 40px);
  min-width: 320px;
  max-width: 55%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.part-inspector-pane[hidden] { display: none; }
.part-inspector-content { display: flex; flex-direction: column; width: 100%; height: 100%; }
.part-inspector-titlebar {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}
.part-inspector-title { min-width: 0; }
.part-inspector-title-line { display: flex; align-items: center; gap: 8px; }
.part-inspector-title h2 {
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}
.part-inspector-title p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}
.inspector-close {
  flex: 0 0 29px;
  width: 29px;
  min-height: 29px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 17px;
}
.inspector-close:hover { color: var(--danger); border-color: #e2b7bc; background: var(--danger-soft); }
.part-inspector-scroll { min-height: 0; overflow: auto; }
.part-inspector-stats { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.part-inspector-stats dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.part-inspector-stats dl > div { min-width: 0; padding: 7px 10px; border-left: 1px solid var(--line); }
.part-inspector-stats dl > div:nth-child(odd) { padding-left: 0; border-left: 0; }
.part-inspector-stats dt,
.part-inspector-details dt { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.part-inspector-stats dd { margin: 0; overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.part-inspector-section { border-bottom: 1px solid var(--line); }
.inspector-section-heading { padding: 14px 16px 10px; }
.inspector-section-heading h3 { margin: 4px 0 0; font-size: 13px; }
.part-inspector-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  margin: 0;
  padding: 0 16px 14px;
}
.part-inspector-details > div { min-width: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.part-inspector-details .wide { grid-column: 1 / -1; }
.part-inspector-details dd { margin: 0; overflow-wrap: anywhere; font-size: 11px; }
.part-inspector-details code { font-size: 9px; }
.inspector-table-wrap { overflow: auto; border-top: 1px solid var(--line); }
.inspector-table th { position: static; padding: 8px 10px; font-size: 8px; }
.inspector-table td { padding: 9px 10px; font-size: 10px; }
.inspector-table td:first-child strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.inspector-table .badge { min-height: 18px; padding: 2px 6px; font-size: 8px; }
.inspector-history { border-top: 1px solid var(--line); }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #edf0f2; }
.history-row:last-child { border-bottom: 0; }
.history-row > div { min-width: 0; }
.history-row strong { display: block; font-size: 11px; }
.history-row span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.history-row time { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.inspector-empty,
.inspector-error,
.inspector-loading { padding: 26px 16px; color: var(--muted); font-size: 11px; text-align: center; }
.inspector-error strong { color: var(--danger); font-size: 13px; }
.inspector-error p { overflow-wrap: anywhere; }
.inspector-loading { display: grid; place-items: center; height: 100%; align-content: center; }
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #d9e1e4;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: inspector-spin .7s linear infinite;
}
@keyframes inspector-spin { to { transform: rotate(360deg); } }

.upload-card { margin-bottom: 18px; }
.upload-form { padding: 0 22px 20px; }
.upload-dropzone {
  display: grid;
  place-items: center;
  min-height: 158px;
  padding: 24px;
  border: 1px dashed #aebbc3;
  border-radius: 11px;
  cursor: pointer;
  background: var(--surface-soft);
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.upload-dropzone:hover,
.upload-dropzone.dragging,
.upload-dropzone.has-file { border-color: var(--primary); background: var(--primary-soft); }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-dropzone strong { margin-top: 8px; color: var(--text); font-size: 14px; }
.upload-dropzone small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.upload-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: var(--primary);
  background: #dbece7;
  font-size: 24px;
  font-weight: 500;
}
.upload-footer { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 14px; }

.alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.alert.success { color: var(--success); background: var(--success-soft); border-color: #c9e6d9; }
.alert.danger { color: var(--danger); background: var(--danger-soft); border-color: #efc8cd; }
.alert button { min-height: 0; padding: 0; border: 0; color: inherit; background: transparent; font-size: 20px; }
.alert button:hover { background: transparent; }
.empty-state { display: grid; place-items: center; min-height: 150px; padding: 28px; color: var(--muted); text-align: center; font-size: 12px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.pagination a { min-height: 32px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--primary); background: #fff; font-weight: 700; text-decoration: none; }
.pagination a:hover { border-color: #9db9b0; background: var(--primary-soft); }

code { padding: 3px 6px; border-radius: 6px; background: #f1f4f5; font-size: 11px; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(135deg, #e8efee 0%, #f7f8f9 50%, #edf3f1 100%);
}
.login-shell { width: min(390px, 100%); }
.login-heading { margin-bottom: 20px; text-align: center; }
.login-heading img { display: block; width: 76px; height: 49px; margin: 0 auto 12px; object-fit: contain; }
.login-heading h1 { margin: 4px 0 7px; font-size: 28px; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.login-card { padding: 26px; }
.login-form { display: grid; gap: 16px; }
.login-form label span { display: block; margin-bottom: 6px; }
.login-form input { margin: 0; min-height: 44px; }
.login-form button { margin-top: 6px; }
.login-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #efc8cd;
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
}

.maintenance-card { max-width: 760px; }
.maintenance-body { display: grid; gap: 18px; padding: 0 22px 22px; }
.maintenance-state {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #c9e6d9;
  border-radius: 11px;
  background: var(--success-soft);
}
.maintenance-state.enabled { border-color: #ead7a8; background: var(--warning-soft); }
.maintenance-state-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 20px;
  font-weight: 800;
}
.maintenance-state.enabled .maintenance-state-icon { background: var(--warning); }
.maintenance-state strong { display: block; font-size: 14px; }
.maintenance-state p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.notices-filter-card { margin-bottom: 18px; padding: 16px; }
.notice-filters { display: grid; grid-template-columns: 1.25fr 1fr auto; align-items: end; gap: 18px; }
.filter-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 9px; background: #eef1f3; }
.segmented a { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.segmented a:hover { color: var(--text); background: rgba(255,255,255,.6); }
.segmented a.active { color: var(--primary); background: #fff; box-shadow: 0 2px 7px rgba(21,31,40,.08); }
.notice-list { display: grid; gap: 18px; }
.notice-list > .card + .card { margin-top: 0; }
.notice-heading { border-bottom: 1px solid var(--line); }
.notice-layout { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 18px 22px 22px; }
.notice-layout.with-media { grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr); }
.notice-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.notice-media > :first-child { grid-column: 1 / -1; }
.notice-media img,
.notice-media video { display: block; width: 100%; height: 120px; border-radius: 9px; object-fit: cover; background: #17212a; }
.notice-media > :first-child img,
.notice-media > video:first-child { height: 260px; }
.notice-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.notice-details > div { padding: 10px 0; border-top: 1px solid var(--line); }
.notice-details > div:nth-child(odd):not(.wide) { padding-right: 18px; }
.notice-details .wide { grid-column: 1 / -1; }
.notice-details dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.notice-details dd { margin: 0; font-size: 12px; white-space: pre-wrap; }
.notice-details .admin-comment { margin-top: 7px; padding: 11px 12px; border: 0; border-radius: 8px; background: var(--warning-soft); }
.moderation-actions { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; }
.moderation-actions form { margin: 0; }
.ban-control { position: relative; }
.ban-control summary { list-style: none; }
.ban-control summary::-webkit-details-marker { display: none; }
.ban-control[open] > form {
  position: absolute;
  z-index: 5;
  top: 44px;
  right: 0;
  width: min(360px, calc(100vw - 50px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(21,31,40,.16);
}

.search-cache-toolbar { margin-bottom: 18px; padding: 15px; }
.search-cache-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px auto;
  align-items: start;
  gap: 10px;
}
.search-cache-query { min-width: 0; }
.search-cache-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  padding-top: 17px;
}
.search-cache-actions > div { display: flex; justify-content: flex-end; gap: 7px; }
.search-cache-actions .result-count { padding-right: 2px; }
.search-cache-table th:first-child,
.search-cache-table td:first-child { width: 44px; text-align: right; }
.search-cache-table td { vertical-align: middle; }
.cache-row-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.cache-query-cell { min-width: 330px; max-width: 520px; }
.cache-query-cell strong,
.cache-query-cell small,
.cache-query-cell code { display: block; }
.cache-query-cell strong { margin: 4px 0; overflow-wrap: anywhere; }
.cache-query-cell small {
  display: -webkit-box;
  margin-bottom: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cache-query-cell code {
  max-width: 310px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cache-debug-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.cache-debug-stat { padding: 16px 18px; }
.cache-debug-stat span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.cache-debug-stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.cache-request-card { margin-bottom: 18px; padding-bottom: 18px; }
.cache-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 4px 22px 12px;
}
.cache-meta > div { min-width: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.cache-meta > div:nth-child(odd) { padding-right: 18px; }
.cache-meta dt,
.cache-draft-fields dt { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.cache-meta dd,
.cache-draft-fields dd { margin: 0; overflow-wrap: anywhere; font-size: 11px; }
.cache-meta code { font-size: 9px; }
.cache-source-link { display: inline-flex; margin: 0 22px 14px; }
.cache-query-raw {
  max-height: 360px;
  margin: 0 22px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #33414b;
  background: #f6f8f9;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}
.cache-legacy-note {
  margin: 0 22px;
  padding: 13px 14px;
  border: 1px solid #ead7a8;
  border-radius: 9px;
  color: #7b6327;
  background: var(--warning-soft);
  font-size: 11px;
}
.cache-match-list { display: grid; gap: 12px; }
.cache-match { overflow: hidden; }
.cache-match summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  background: #fff;
}
.cache-match summary::-webkit-details-marker { display: none; }
.cache-match[open] summary { border-bottom: 1px solid var(--line); background: #f8faf9; }
.cache-match-index {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 800;
}
.cache-match-title { flex: 1 1 auto; min-width: 0; }
.cache-match-title strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.cache-match-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.cache-match-body { padding: 14px 16px 16px; }
.cache-draft-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 14px;
}
.cache-draft-fields > div { padding: 8px 12px 8px 0; border-top: 1px solid var(--line); }
.cache-candidates-table th { position: static; }
.cache-candidates-table td:first-child { width: 36px; color: var(--muted); text-align: right; }
.cache-candidates-table code { font-size: 9px; }
.cache-truncated {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafb;
  font-size: 10px;
  text-align: center;
}

html.sidebar-user-collapsed { --sidebar-width: 76px; }
html.sidebar-user-collapsed .sidebar { padding: 16px 10px; }
html.sidebar-user-collapsed .brand { justify-content: center; padding: 0 0 18px; }
html.sidebar-user-collapsed .brand-copy,
html.sidebar-user-collapsed .nav-label,
html.sidebar-user-collapsed .logout-label { display: none; }
html.sidebar-user-collapsed .nav-item { justify-content: center; padding: 11px 8px; }
html.sidebar-user-collapsed .nav-icon { width: auto; }
html.sidebar-user-collapsed .logout-button { padding: 0; }
html.sidebar-user-collapsed .sidebar-collapse-icon { transform: rotate(-45deg); }

@media (max-width: 1100px) {
  :root { --sidebar-width: 215px; }
  .main-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; }
  .sidebar-scroll { overflow: visible; }
  .sidebar-collapse-button, .sidebar-bottom { display: none; }
  .brand { padding-bottom: 14px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item { justify-content: flex-start !important; }
  .nav-label { display: inline !important; }
  .main-content { padding: 18px 12px 30px; }
  .topbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar, .filters { align-items: stretch; flex-direction: column; }
  .upload-footer { align-items: stretch; flex-direction: column; }
  .filters label, .parts-filters label { min-width: 0; }
  .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-search { grid-column: 1 / -1; }
  .catalog-filter-summary { align-items: flex-start; flex-direction: column; }
  .parts-split-workspace {
    flex-direction: column;
    overflow: visible;
  }
  .parts-list-pane { flex: 0 0 auto; min-width: 0; }
  .part-inspector-splitter { display: none; }
  .part-inspector-pane {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-width: none;
    min-width: 0;
    max-height: 560px;
    margin-top: 12px;
  }
  .part-inspector-details { grid-template-columns: 1fr; }
  .part-inspector-details .wide { grid-column: auto; }
  .row-actions { align-items: stretch; flex-direction: column; }
  .notice-filters, .notice-layout.with-media { grid-template-columns: 1fr; }
  .search-cache-filters, .cache-debug-grid { grid-template-columns: 1fr; }
  .search-cache-actions { justify-items: stretch; padding-top: 0; }
  .search-cache-actions > div { justify-content: stretch; }
  .search-cache-actions .button { flex: 1 1 auto; }
  .search-cache-actions .result-count { text-align: right; }
  .cache-meta, .cache-draft-fields { grid-template-columns: 1fr; }
  .cache-meta > div:nth-child(odd) { padding-right: 0; }
  .shzn-active-run,
  .shzn-history-heading,
  .shzn-table-footer { align-items: stretch; flex-direction: column; }
  .notice-details { grid-template-columns: 1fr; }
  .notice-details .wide { grid-column: auto; }
  .notice-details > div:nth-child(odd):not(.wide) { padding-right: 0; }
}
