:root {
  --bg: #f7fbf8;
  --panel: #ffffff;
  --panel-soft: #f2faf5;
  --text: #283243;
  --muted: #778091;
  --line: #dce9e2;
  --line-strong: #c8dad1;
  --accent: #69a88f;
  --accent-strong: #4d8f76;
  --accent-soft: #e3f3eb;
  --success: #2d8468;
  --danger: #c95a6a;
  --warning: #a56f24;
  --shadow: 0 18px 55px rgba(80, 112, 96, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(135deg, #f7fbf8 0%, #fff8f6 48%, #f5f1ff 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.boot-mark,
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 74px;
  max-height: 48px;
  object-fit: contain;
}

.brand-logo.large {
  width: 132px;
  max-height: 74px;
  justify-self: start;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 251, 248, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-eyebrow,
.meta-label,
.section-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 2px 0 0;
  font-size: clamp(18px, 2.8vw, 24px);
  line-height: 1.1;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.time-pill {
  min-width: 210px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: right;
}

.time-pill strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 52px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgba(23, 32, 51, 0.04);
}

.tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tab svg,
.button svg,
.icon-button svg,
.quantity-button svg,
.drag-handle svg,
.link-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.tab.external-tab {
  color: #8a6420;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 26px rgba(23, 32, 51, 0.05);
}

.notice.is-error {
  border-color: rgba(201, 90, 106, 0.24);
  background: #fff5f6;
  color: #994050;
}

.notice.is-success {
  border-color: rgba(45, 132, 104, 0.22);
  background: #f2fbf6;
  color: #2d745c;
}

.panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 4px 0 0;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.12;
}

.panel-copy {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button,
.icon-button,
.link-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button {
  padding: 0 14px;
}

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

.button.primary {
  background: var(--accent);
  color: #fff;
}

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

.button.secondary,
.icon-button,
.link-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.button.danger {
  border-color: rgba(201, 90, 106, 0.24);
  background: #fff2f4;
  color: var(--danger);
}

.button:disabled,
.icon-button:disabled,
.quantity-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.danger-icon {
  border-color: rgba(201, 90, 106, 0.24);
  background: #fff2f4;
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

.request-table,
.archive-table,
.print-table {
  width: 100%;
  border-collapse: collapse;
}

.request-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.request-table .col-product {
  width: auto;
}

.request-table .col-price {
  width: 112px;
}

.request-table .col-quantity {
  width: 168px;
}

.request-table .col-total {
  width: 154px;
}

.request-table th,
.request-table td,
.archive-table th,
.archive-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.request-table th,
.archive-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.request-table td:nth-child(2),
.request-table td:nth-child(4),
.request-table th:nth-child(2),
.request-table th:nth-child(4) {
  text-align: right;
}

.request-table td:nth-child(3),
.request-table th:nth-child(3) {
  text-align: center;
}

.request-table td:nth-child(4),
.request-table th:nth-child(4) {
  padding-right: 20px;
}

.request-table td:nth-child(4) {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.product-name {
  min-width: 0;
  font-weight: 800;
}

.product-name-cell {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.product-name-cell span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.product-icon i {
  font-size: 15px;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money.is-negative {
  color: var(--danger);
}

.quantity-input,
.field-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 8px 10px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 44px 62px 44px;
  justify-content: center;
  gap: 6px;
}

.quantity-input {
  width: 62px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.quantity-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent-strong);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.quantity-button:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.quantity-input:focus,
.field-input:focus {
  border-color: rgba(105, 168, 143, 0.72);
  box-shadow: 0 0 0 4px rgba(105, 168, 143, 0.14);
}

.sheet-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 20px 22px;
}

.request-note-panel {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 18px 22px 0;
}

.note-toggle {
  border-color: #ead392;
  background: #fff8df;
  color: #8a6420;
}

.note-toggle:hover,
.note-toggle.has-note {
  border-color: #d8bd68;
  background: #fff1ba;
  color: #7a5415;
}

.note-editor {
  width: min(640px, 100%);
  padding: 14px;
  border: 1px solid #ead392;
  border-radius: 8px;
  background: #fff8df;
  color: #8a6420;
}

.note-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.note-label svg {
  width: 17px;
  height: 17px;
}

.note-input {
  min-height: 84px;
  resize: vertical;
}

.signature-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 14px;
}

.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.readonly-field {
  display: flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.total-box {
  min-width: 230px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7f4ed;
  color: var(--text);
  text-align: right;
}

.total-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.total-box strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 46px 22px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.empty-state h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 180px auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.product-list {
  display: grid;
}

.product-editor {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(190px, 1fr) 126px 168px 158px 94px 144px;
  gap: 12px;
  align-items: center;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  transition:
    background 160ms ease,
    opacity 160ms ease;
}

.product-editor:last-child {
  border-bottom: 0;
}

.product-editor.is-dragging {
  opacity: 0.46;
}

.product-editor.is-drag-over-before::before,
.product-editor.is-drag-over-after::after {
  position: absolute;
  right: 22px;
  left: 22px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.product-editor.is-drag-over-before::before {
  top: -2px;
}

.product-editor.is-drag-over-after::after {
  bottom: -2px;
}

.drag-handle {
  display: inline-flex;
  width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: grab;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.icon-edit-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-button {
  position: relative;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.file-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e5f4ed;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.status-badge.is-muted {
  background: #f2edf9;
  color: var(--muted);
}

.product-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.35fr);
  min-height: 520px;
}

.archive-list {
  border-right: 1px solid var(--line);
}

.archive-row {
  display: grid;
  width: 100%;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.archive-row:hover,
.archive-row.is-active {
  background: #fff8f6;
}

.archive-number {
  color: var(--accent);
  font-weight: 900;
}

.archive-date {
  min-width: 0;
}

.archive-date strong,
.archive-total {
  display: block;
  font-weight: 850;
}

.archive-date span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.archive-detail {
  min-width: 0;
  padding: 22px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.detail-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.summary-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.analytics-content {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.shop-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: end;
  padding: 20px;
  border: 1px solid #f1dfd2;
  border-radius: 8px;
  background: #fff8f1;
}

.shop-dashboard-hero h3 {
  margin: 4px 0 4px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}

.shop-dashboard-hero span {
  color: var(--muted);
  font-weight: 750;
}

.market-sparkline {
  display: grid;
  height: 96px;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
}

.market-sparkline span {
  display: block;
  min-height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: #69a88f;
}

.analytics-metrics,
.analytics-period-grid,
.product-analytics-grid {
  display: grid;
  gap: 14px;
}

.analytics-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-period-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-analytics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.analytics-card,
.product-breakdown {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.metric-card {
  padding: 18px;
}

.metric-card-head,
.analytics-card-head,
.product-row-top,
.product-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-card-head span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.metric-card p,
.metric-card small,
.product-row-meta {
  color: var(--muted);
}

.metric-card p {
  margin: 8px 0 4px;
  font-weight: 750;
}

.metric-card small {
  font-size: 12px;
}

.analytics-card,
.product-breakdown {
  padding: 18px;
}

.analytics-card-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.analytics-card-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.comparison-bars {
  display: grid;
  gap: 12px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.75fr) minmax(72px, 1fr) minmax(66px, max-content);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.comparison-row span,
.comparison-row strong {
  font-size: 13px;
  min-width: 0;
}

.comparison-row strong {
  justify-self: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comparison-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-row.previous {
  color: var(--muted);
}

.comparison-track,
.product-bar-track {
  position: relative;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #f2ede7;
}

.comparison-track b,
.product-bar-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f6a66f;
}

.comparison-row.previous .comparison-track b {
  background: #b8d7c9;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.mini-stats div {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mini-stats strong {
  display: block;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.soft-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff8f1;
  color: #a55b25;
  font-size: 12px;
  font-weight: 850;
}

.product-breakdown {
  display: grid;
  gap: 14px;
}

.product-bar-row {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.product-row-top strong {
  min-width: 0;
}

.product-row-top span {
  color: var(--text);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.product-bar-track {
  height: 10px;
}

.product-bar-track b {
  background: #69a88f;
}

.product-bar-track b.negative {
  background: #d98a96;
}

.product-row-meta {
  font-size: 12px;
}

.inline-empty {
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.setup-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.setup-panel,
.pin-lock-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pin-lock-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, #f7fbf8 0%, #fff8f6 52%, #f5f1ff 100%);
}

.setup-panel header,
.pin-lock-panel header,
.setup-panel form,
.pin-form,
.settings-form {
  display: grid;
  gap: 14px;
}

.setup-panel header,
.pin-lock-panel header {
  padding: 24px 24px 0;
}

.setup-panel h1,
.pin-lock-panel h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1;
}

.setup-panel p,
.pin-lock-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.setup-panel form,
.pin-form,
.settings-form {
  padding: 24px;
}

.pin-input {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.34em;
  outline: none;
  padding: 8px 14px;
  text-align: center;
}

.settings-form {
  border-top: 1px solid var(--line);
}

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

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-section-head h3 {
  margin: 4px 0;
  font-size: 18px;
}

.settings-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.archived-note {
  display: flex;
  gap: 10px;
  margin: 16px;
  padding: 13px 14px;
  border: 1px solid #ead392;
  border-radius: 8px;
  background: #fff8df;
  color: #8a6420;
}

.archived-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.archived-note span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archived-note p {
  margin: 4px 0 0;
  color: var(--text);
  line-height: 1.45;
}

.config-source {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.is-busy {
  pointer-events: none;
}

.print-sheet {
  display: none;
}

@media (max-width: 880px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta,
  .time-pill {
    width: 100%;
    text-align: left;
  }

  .workspace {
    width: min(100% - 22px, 1180px);
    margin-top: 18px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .panel-header,
  .sheet-footer,
  .detail-head,
  .detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .sheet-footer,
  .signature-grid,
  .form-grid,
  .archive-layout,
  .summary-strip,
  .shop-dashboard-hero,
  .analytics-metrics,
  .analytics-period-grid,
  .product-analytics-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .product-editor {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .product-editor .field-label,
  .product-editor .icon-edit-tools,
  .product-editor .status-badge,
  .product-editor .product-actions {
    grid-column: 1 / -1;
  }

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

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

  .request-table .col-quantity {
    width: 162px;
  }

  .request-table .col-total {
    width: 148px;
  }

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

  .comparison-row strong {
    text-align: left;
  }

  .product-row-top,
  .product-row-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .archive-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .total-box {
    min-width: 0;
    text-align: left;
  }

  .brand-logo {
    width: 68px;
  }
}

@media print {
  @page {
    margin: 14mm;
    size: A4;
  }

  body {
    background: #fff;
    color: #111;
  }

  .app-shell {
    display: none !important;
  }

  .print-sheet {
    display: block;
    font-family:
      Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", sans-serif;
  }

  .print-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
  }

  .print-head h1 {
    margin: 0;
    font-size: 24px;
  }

  .print-kicker {
    margin: 0 0 6px;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .print-logo {
    display: block;
    max-width: 115px;
    max-height: 58px;
    margin-bottom: 12px;
    object-fit: contain;
  }

  .print-head p {
    margin: 5px 0 0;
    color: #555;
  }

  .print-meta {
    text-align: right;
    font-size: 12px;
    line-height: 1.6;
  }

  .print-document-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 18px;
  }

  .print-document-info div {
    min-height: 58px;
    padding: 10px;
    border: 1px solid #d0d0d0;
  }

  .print-document-info span {
    display: block;
    color: #666;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .print-document-info strong {
    display: block;
    margin-top: 8px;
    font-size: 13px;
  }

  .print-note {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #d8bd68;
    background: #fff8df;
  }

  .print-note span {
    display: block;
    color: #8a6420;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .print-note p {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.45;
  }

  .print-table th,
  .print-table td {
    padding: 8px 9px;
    border: 1px solid #d0d0d0;
    font-size: 12px;
  }

  .print-table th {
    background: #f2f2f2;
    text-align: left;
  }

  .print-table td:nth-child(2),
  .print-table td:nth-child(3),
  .print-table td:nth-child(4),
  .print-table th:nth-child(2),
  .print-table th:nth-child(3),
  .print-table th:nth-child(4) {
    text-align: right;
  }

  .print-total {
    margin-top: 16px;
    text-align: right;
    font-size: 16px;
    font-weight: 800;
  }

  .print-date-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    font-size: 13px;
  }

  .print-signature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 34px;
    font-size: 13px;
  }

  .print-line {
    min-height: 34px;
    border-bottom: 1px solid #111;
  }

  .signature-box {
    display: grid;
    gap: 7px;
  }

  .signature-box span {
    color: #555;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .signature-box strong {
    font-size: 14px;
  }

  .signature-box small {
    color: #666;
    text-align: right;
  }
}
