:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7890;
  --line: #dbe5f2;
  --brand: #1677ff;
  --brand-2: #0958d9;
  --gold: #4f8cff;
  --ink: #0b1d3a;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #166534;
  --font-base: 15px;
  --font-small: 13px;
  --font-ui: 14px;
  --font-title: 24px;
  --font-panel-title: 17px;
}
html.font-small {
  --font-base: 14px;
  --font-small: 12px;
  --font-ui: 13px;
  --font-title: 23px;
  --font-panel-title: 16px;
}
html.font-medium {
  --font-base: 15px;
  --font-small: 13px;
  --font-ui: 14px;
  --font-title: 24px;
  --font-panel-title: 17px;
}
html.font-large {
  --font-base: 16px;
  --font-small: 14px;
  --font-ui: 15px;
  --font-title: 25px;
  --font-panel-title: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: var(--font-base);
  color: var(--text);
  background:
    radial-gradient(circle at 78% 0%, rgba(22,119,255,.13), rgba(22,119,255,0) 340px),
    linear-gradient(180deg, rgba(22,119,255,.07), rgba(243,246,251,0) 260px),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 260px;
  background:
    linear-gradient(180deg, #123b75 0%, #071b3d 100%);
  color: #edf5ff;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  padding: 18px 14px;
  box-shadow: 10px 0 30px rgba(7, 27, 61, .18);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 8px 6px 18px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #b9d6ff);
  color: #0b4fb3;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px rgba(0,0,0,.18);
}
.brand strong { display: block; line-height: 1.25; }
.brand span { display: block; color: #bcd7ff; margin-top: 3px; font-size: var(--font-small); }
.sidebar h3 {
  color: #9cc4ff;
  font-size: var(--font-small);
  margin: 18px 8px 8px;
  font-weight: 600;
}
.sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 7px;
  margin: 2px 0;
  color: #edf5ff;
  font-size: var(--font-ui);
}
.sidebar a.active, .sidebar a:hover {
  background: rgba(255,255,255,.13);
  box-shadow: inset 3px 0 0 #79b8ff;
}

.main {
  flex: 1;
  margin-left: 260px;
  padding: 26px;
  min-width: 0;
}
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(215,222,232,.9);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 14px 38px rgba(23, 32, 51, .07);
}
h1 { margin: 0; font-size: var(--font-title); letter-spacing: 0; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.userbar { color: var(--muted); font-size: var(--font-ui); display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.userbar a { color: var(--brand); margin-left: 10px; font-weight: 700; }
.font-size-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}
.font-size-control span {
  padding: 0 6px;
  color: var(--muted);
  font-size: var(--font-small);
}
.font-size-control button {
  min-width: 30px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #516076;
  cursor: pointer;
  font-weight: 700;
}
.font-size-control button.active,
.font-size-control button:hover {
  background: var(--brand);
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 14px 34px rgba(23, 32, 51, .06);
  overflow: visible;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: var(--font-panel-title);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #69a8ff, var(--brand));
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric {
  background:
    linear-gradient(135deg, rgba(22,119,255,.10), rgba(255,255,255,0) 55%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 98px;
}
.metric span { display: block; color: var(--muted); font-size: var(--font-small); }
.metric strong { display: block; margin-top: 8px; font-size: 26px; }

.quick-grid { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 16px; }
.quick-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #f3f8ff);
  min-height: 86px;
}
.quick-card:hover {
  border-color: rgba(22,119,255,.38);
  box-shadow: 0 12px 30px rgba(22,119,255,.14);
}
.quick-card span { display: block; font-weight: 700; }
.quick-card b { display: inline-block; margin-top: 14px; color: var(--brand); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 16px;
  align-items: end;
}
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 16px;
  align-items: end;
}
.filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: var(--font-ui); }
input, select {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus {
  outline: 3px solid rgba(22,119,255,.14);
  border-color: var(--brand);
}
.enhanced-select-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.search-select {
  position: relative;
  z-index: 2;
  width: 100%;
}
.search-select.open {
  z-index: 80;
}
.search-select-toggle {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}
.search-select-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-select-toggle span.placeholder {
  color: var(--muted);
}
.search-select-toggle b {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #7c8aa0;
  justify-self: end;
}
.search-select.open .search-select-toggle,
.search-select-toggle:focus {
  outline: 3px solid rgba(22,119,255,.14);
  border-color: var(--brand);
}
.search-select-input {
  width: 100%;
  height: 34px;
  margin-bottom: 6px;
  background: #f8fbff;
}
.search-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(23, 32, 51, .18);
  padding: 6px;
}
.search-select.open .search-select-menu {
  display: block;
}
.search-select-options {
  display: grid;
  gap: 3px;
}
.search-select-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  font-size: var(--font-ui);
}
.search-select-option:hover {
  background: #eef6ff;
  color: var(--brand-2);
}
.search-select-option.selected {
  background: #e7f1ff;
  color: var(--brand-2);
  font-weight: 700;
}
.search-select-empty {
  color: var(--muted);
  padding: 10px;
  font-size: var(--font-small);
}
.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.table-tools h2 {
  margin-bottom: 0;
}
.table-search {
  width: min(340px, 100%);
}
.table-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 2px;
}
.table-page-size,
.table-page-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--font-small);
}
.table-page-size select,
.table-page-size input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 9px;
  outline: none;
}
.table-page-size input {
  width: 88px;
}
.table-pager:not(.expanded) .table-page-size {
  display: none;
}
.table-page-nav {
  min-height: 34px;
  padding: 3px 6px;
  background: #f6faff;
  border: 1px solid #d8e6f7;
  border-radius: 999px;
}
.table-page-nav strong {
  min-width: 150px;
  text-align: center;
  color: #21476f;
  font-weight: 700;
}
.page-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(38,88,146,.12);
}
.page-icon:disabled {
  cursor: not-allowed;
  color: #a8b6c8;
  background: #edf3fb;
  box-shadow: none;
}
.mini { width: 78px; }
.btn {
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 0 14px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, #2f8cff, var(--brand-2)); color: #fff; border-color: var(--brand); }
.btn:hover { border-color: rgba(22,119,255,.45); }
.btn.small { height: 30px; padding: 0 9px; font-size: var(--font-small); }
.danger-btn { color: var(--danger); }
.full { width: 100%; }
.inline { display: inline-flex; gap: 6px; margin: 2px; align-items: center; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: var(--font-ui);
}
th { color: #344563; background: #f7faff; font-weight: 700; }
th[data-sortable] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 22px;
}
th[data-sortable]::after {
  content: "↕";
  position: absolute;
  right: 8px;
  color: #9aa8bd;
  font-size: var(--font-small);
}
th[data-sort-dir="asc"]::after { content: "↑"; color: var(--brand); }
th[data-sort-dir="desc"]::after { content: "↓"; color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 28px; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--font-small);
}
.badge.on { background: #dcfce7; color: var(--ok); }
.badge.off { background: #f3f4f6; color: var(--muted); }
.badge.warn { background: #fff7ed; color: var(--warn); }
.badge.danger-badge { background: #fee2e2; color: var(--danger); }
.danger { color: var(--danger); font-weight: 700; }
.ok-text { color: var(--ok); font-weight: 700; }
.muted-text { color: var(--muted); font-weight: 700; }
.money { color: #8a5a0a; font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-size: var(--font-small); margin-left: 3px; }
.muted { color: var(--muted); margin: 0; }
.json-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: transform .16s ease;
}
.image-pop {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.image-pop .preview {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 280px;
  max-height: 460px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 20px 55px rgba(23, 32, 51, .24);
}
.image-pop:hover .preview { display: block; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .36);
  z-index: 50;
  padding: 40px 18px;
}
.modal.show { display: grid; place-items: start center; }
.modal-box {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  width: min(720px, 100%);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}
.modal-box.wide { width: min(980px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 60px; gap: 10px; align-items: center; }
.bar-row div { height: 12px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
.bar-row i { display: block; height: 100%; background: linear-gradient(90deg, #69a8ff, var(--brand-2)); border-radius: 999px; }
.input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-unit input { flex: 1; }
.input-unit b {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.materials-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
}
.materials-actions.materials-workbench {
  grid-template-columns: minmax(560px, 1.45fr) minmax(340px, .9fr);
}
.materials-actions .panel {
  height: 100%;
  margin-bottom: 0;
}
.materials-actions .material-create {
  grid-column: 1 / -1;
}
.materials-actions.materials-workbench .material-create {
  grid-column: auto;
}
.materials-actions .material-create .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.material-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .62fr);
  gap: 18px;
  align-items: start;
}
.material-create-form {
  align-items: end;
}
.material-import-box,
.material-op-stack > div {
  border: 1px solid #dbe8f8;
  background: #f8fbff;
  border-radius: 8px;
  padding: 14px;
}
.material-import-box h3,
.material-op-stack h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: var(--font-ui);
}
.material-import-box .form-row,
.material-op-stack .form-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.material-op-stack {
  display: grid;
  gap: 14px;
}
.compact-form,
.modal-form {
  grid-template-columns: 1fr;
}
.materials-data {
  margin-top: 18px;
}
.qty-edit {
  margin-left: 8px;
  vertical-align: middle;
}
.receipt-batch-form {
  display: grid;
  gap: 14px;
}
.receipt-batch-head {
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
}
.batch-common {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr) minmax(150px, .55fr) minmax(240px, .8fr) auto;
  gap: 12px;
  align-items: end;
}
.sample-preview-field textarea {
  min-height: 44px;
  resize: vertical;
  cursor: default;
  color: #0f2f5f;
  background: #f3f8ff;
  border-color: #c7daf2;
  font-weight: 700;
  line-height: 1.55;
}
.receipt-batch-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(240px, 1.2fr) minmax(110px, .5fr) minmax(170px, .7fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  overflow: visible;
}
.receipt-batch-row.compact-batch-row {
  grid-template-columns: minmax(280px, 1.4fr) minmax(120px, .45fr) minmax(170px, .7fr) auto;
}
.worker-unfinished-box {
  grid-column: 1 / -1;
  border: 1px solid #cfe0f5;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border-radius: 8px;
  padding: 14px;
  min-height: 74px;
}
.worker-unfinished-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.worker-unfinished-head strong {
  color: var(--ink);
  font-size: 15px;
}
.worker-unfinished-head span {
  color: var(--muted);
  font-size: 12px;
}
.worker-unfinished-table {
  overflow-x: auto;
}
.worker-unfinished-table table {
  min-width: 560px;
}
.worker-unfinished-table th,
.worker-unfinished-table td {
  padding: 9px 8px;
  font-size: 12px;
}
.modal-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: #f3f8ff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.home-page {
  min-height: 100vh;
  color: #13223a;
  background:
    radial-gradient(circle at 18% 8%, rgba(22,119,255,.16), transparent 330px),
    radial-gradient(circle at 82% 20%, rgba(84,137,255,.20), transparent 360px),
    linear-gradient(180deg, #f7fbff 0%, #edf5ff 58%, #f8fbff 100%);
}
.home-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 54px;
}
.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.home-brand { color: #0c1e3e; padding: 0; }
.home-brand span { color: #64748b; }
.home-login,
.home-primary,
.home-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}
.home-login,
.home-primary {
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  box-shadow: 0 12px 24px rgba(22,119,255,.22);
}
.home-secondary {
  color: #1554b0;
  background: #fff;
  border: 1px solid #d6e4ff;
}
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, .98fr);
  gap: 34px;
  align-items: stretch;
  min-height: 520px;
  padding: 34px;
  border: 1px solid rgba(183,203,232,.86);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,246,255,.88)),
    #fff;
  box-shadow: 0 28px 70px rgba(21, 70, 140, .14);
  overflow: hidden;
}
.home-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.home-copy > span {
  color: #1677ff;
  font-weight: 800;
  letter-spacing: 0;
}
.home-copy h1 {
  margin: 16px 0 18px;
  font-size: 48px;
  line-height: 1.08;
  color: #0b1d3a;
  max-width: 720px;
}
.home-copy p {
  width: min(650px, 100%);
  color: #52627a;
  font-size: 17px;
  line-height: 1.8;
  margin: 0;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.home-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.home-tags b {
  color: #31557f;
  background: #eef6ff;
  border: 1px solid #d7e8ff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.home-visual {
  position: relative;
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #0c1e3e, #1a4d8f);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.home-visual img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}
.home-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,29,61,0) 46%, rgba(9,29,61,.68) 100%);
}
.home-visual-card {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 1;
  padding: 16px 18px;
  border-radius: 10px;
  color: #fff;
  background: rgba(9, 29, 61, .72);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px);
}
.home-visual-card strong { display: block; font-size: 18px; }
.home-visual-card span { display: block; margin-top: 5px; color: rgba(255,255,255,.74); }
.home-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 30px;
}
.home-board div {
  min-height: 112px;
  background: rgba(255,255,255,.92);
  border: 1px solid #dce9f8;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 16px 38px rgba(21, 70, 140, .08);
}
.home-board span { color: #64748b; }
.home-board strong {
  display: inline-block;
  margin-top: 12px;
  font-size: 34px;
  color: #0958d9;
}
.home-board b { color: #64748b; margin-left: 4px; }
.home-overview {
  padding: 28px 0 0;
}
.home-section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}
.home-section-title span { color: #1677ff; font-weight: 800; }
.home-section-title h2 {
  margin: 0;
  font-size: 28px;
  color: #0b1d3a;
}
.home-values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.home-values div {
  min-height: 170px;
  background: #fff;
  border: 1px solid #dce9f8;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 16px 38px rgba(21, 70, 140, .08);
}
.home-values em {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #0958d9;
  background: #edf6ff;
  font-style: normal;
  font-weight: 900;
  margin-bottom: 16px;
}
.home-values strong { display: block; margin-bottom: 8px; font-size: 16px; }
.home-values span { color: #64748b; line-height: 1.7; }

.print-page {
  background: #e8eef6;
}
.issue-print {
  width: 780px;
  margin: 28px auto;
  background: #fff;
  border: 1px solid #cfd9e8;
  padding: 34px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, .18);
}
.print-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 3px solid var(--brand);
  padding-bottom: 18px;
}
.print-head h1 { font-size: 30px; }
.print-head p { margin: 8px 0 0; color: var(--muted); }
.print-head strong { color: var(--brand-2); }
.print-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid #d8e2ef;
  border-bottom: 0;
  margin-top: 24px;
}
.print-grid div {
  display: grid;
  grid-template-columns: 118px 1fr;
  border-bottom: 1px solid #d8e2ef;
}
.print-grid div:nth-child(odd) { border-right: 1px solid #d8e2ef; }
.print-grid span {
  background: #f5f8fc;
  color: #4b5b75;
  padding: 12px;
}
.print-grid b {
  padding: 12px;
  font-weight: 700;
}
.print-sign {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 36px;
  min-height: 68px;
}
.print-sign div {
  border-bottom: 1px solid #94a3b8;
  padding-top: 32px;
}
.print-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f4f6f8 0%, #dfe9e6 100%);
}
.login-shell { width: min(420px, calc(100% - 32px)); }
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .12);
}
.login-card h1 { margin-top: 14px; }
.login-card p { color: var(--muted); margin: 8px 0 22px; }
.login-card form { display: grid; gap: 14px; }

@media (max-width: 980px) {
  .sidebar { position: static; width: 100%; max-height: none; }
  .app-shell { display: block; }
  .main { margin-left: 0; padding: 14px; }
  .topbar { display: block; }
  .userbar { margin-top: 10px; }
  .metric-grid, .quick-grid, .form-grid, .filter-grid, .materials-actions, .materials-actions.materials-workbench, .material-create-grid, .receipt-batch-head, .batch-common, .receipt-batch-row, .receipt-batch-row.compact-batch-row { grid-template-columns: 1fr; }
  .materials-actions .material-create { grid-row: auto; grid-column: auto; }
  .home-shell { width: min(100% - 28px, 760px); padding-top: 18px; }
  .home-nav { margin-bottom: 16px; align-items: flex-start; }
  .home-hero { grid-template-columns: 1fr; padding: 22px; min-height: 0; }
  .home-copy h1 { font-size: 34px; }
  .home-copy p { font-size: 15px; }
  .home-visual, .home-visual img { min-height: 260px; }
  .home-board { grid-template-columns: repeat(2, 1fr); }
  .home-values { grid-template-columns: 1fr; }
  .home-overview { padding-top: 18px; }
  .home-section-title { display: block; }
  .home-section-title h2 { margin-top: 8px; font-size: 23px; }
  .form-row { display: grid; grid-template-columns: 1fr; }
  table { min-width: 900px; }
}

@media (max-width: 560px) {
  .home-nav { display: grid; grid-template-columns: 1fr; }
  .home-login { width: 100%; }
  .home-board { grid-template-columns: 1fr; }
  .home-actions { display: grid; grid-template-columns: 1fr; }
  .home-primary, .home-secondary { width: 100%; }
}

@media print {
  body.print-page { background: #fff; }
  .issue-print {
    width: auto;
    margin: 0;
    box-shadow: none;
    border: 0;
  }
  .print-actions { display: none; }
}
