:root {
  --ink: #17191c;
  --ink-soft: #272a2f;
  --paper: #f5f4f0;
  --surface: #ffffff;
  --line: #deddd8;
  --muted: #6c6d70;
  --accent: #b88a44;
  --accent-dark: #8d652b;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning-soft: #fff8e8;
  --success: #276749;
  --shadow: 0 20px 60px rgba(23, 25, 28, 0.1);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(184, 138, 68, 0.35);
  outline-offset: 2px;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(480px, 1.1fr);
}

.login-brand {
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f9f8f4;
  background:
    linear-gradient(135deg, rgba(184, 138, 68, 0.16), transparent 45%),
    var(--ink);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.7rem;
  color: var(--accent);
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
}

.brand-copy { max-width: 34rem; }

.brand-copy h1 {
  max-width: 30rem;
  margin: 0.75rem 0 1.2rem;
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1.02;
  font-weight: 600;
}

.brand-copy > p:last-child {
  max-width: 29rem;
  color: rgba(249, 248, 244, 0.7);
  font-size: 1.05rem;
  line-height: 1.7;
}

.brand-footer {
  margin: 0;
  color: rgba(249, 248, 244, 0.48);
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-brand .eyebrow { color: var(--accent); }

.login-panel {
  min-height: 100vh;
  padding: 2rem;
  display: grid;
  place-items: center;
}

.login-card { width: min(100%, 28rem); }

.login-card h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
}

.supporting-text {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
}

input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.8rem 2.2rem 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

input:hover { border-color: #c4c1b8; }

.password-field { position: relative; display: block; }
.password-field input { padding-right: 5.5rem; }

.icon-button {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  min-height: 2.2rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.button {
  min-height: 3rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-weight: 600;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.button:not(:disabled):active { transform: translateY(1px); }
.button:disabled { opacity: 0.65; }
.button-block { width: 100%; }

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

.button-primary:not(:disabled):hover { background: var(--ink-soft); }

.button-loader {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.is-loading .button-label { display: none; }
.button.is-loading .button-loader { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-message { min-height: 1.25rem; font-size: 0.88rem; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

.login-help {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.alert-warning { margin-top: 1.3rem; color: #70510f; background: var(--warning-soft); }
.alert-error { margin-bottom: 1rem; color: var(--danger); background: var(--danger-soft); }
.alert-success { margin-bottom: 1rem; color: var(--success); background: #edf8f2; }
.alert code { font-size: 0.82rem; }

[hidden] { display: none !important; }

.page-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  color: var(--muted);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); }

.sidebar {
  min-height: 100vh;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2e3136;
  background: var(--ink);
  color: #ffffff;
}

.sidebar-brand { padding: 0 0.65rem; }

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
  margin-top: 2.5rem;
}

.nav-item {
  min-height: 2.8rem;
  padding: 0.7rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 0.55rem;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.nav-item.active { color: #ffffff; background: rgba(255, 255, 255, 0.09); }
.nav-item-muted { opacity: 0.62; }

.logout-button {
  min-height: 2.8rem;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  color: #ffffff;
  background: transparent;
}

.dashboard-main { min-width: 0; padding: clamp(1.25rem, 3vw, 2.6rem); }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
}

.user-chip { display: flex; align-items: center; gap: 0.75rem; }

.user-chip strong,
.user-chip small { display: block; }
.user-chip strong { font-size: 0.9rem; }
.user-chip small { margin-top: 0.15rem; color: var(--muted); font-size: 0.76rem; }

.user-avatar {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card,
.content-card {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(23, 25, 28, 0.035);
}

.metric-card { padding: 1.15rem; }
.metric-card > span { color: var(--muted); font-size: 0.84rem; }
.metric-card strong { display: block; margin: 0.5rem 0; font-size: 2rem; font-weight: 600; }
.metric-card small { color: var(--muted); font-size: 0.76rem; }
.metric-card-alert { border-top: 3px solid var(--accent); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 0.8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.content-card { min-width: 0; padding: 1.2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }

.table-wrap { width: 100%; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 0.65rem; border-bottom: 1px solid #ecebe7; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 0.76rem; font-weight: 500; }
td { font-size: 0.86rem; }
tbody tr:last-child td { border-bottom: 0; }
.text-right { text-align: right; }
.empty-cell { padding: 2.5rem 1rem; color: var(--muted); text-align: center; }

.status-badge {
  display: inline-flex;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: #eeede9;
  font-size: 0.72rem;
  font-weight: 500;
}

.status-confirmado,
.status-separando { color: #70510f; background: var(--warning-soft); }
.status-entregue { color: var(--success); background: #edf8f2; }
.status-cancelado { color: var(--danger); background: var(--danger-soft); }

.stock-list { margin: 0; padding: 0; list-style: none; }
.stock-list li {
  padding: 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #ecebe7;
}
.stock-list li:last-child { border-bottom: 0; }
.stock-list strong,
.stock-list small { display: block; }
.stock-list strong { font-size: 0.86rem; }
.stock-list small { margin-top: 0.2rem; color: var(--muted); font-size: 0.76rem; }
.stock-quantity { color: var(--danger); font-size: 0.8rem; font-weight: 600; }
.empty-list { color: var(--muted); font-size: 0.86rem; }

.page-description {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.page-header-actions { align-items: flex-end; }
.clients-card { padding: 1.3rem; }

.list-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.list-toolbar h2 { margin: 0; font-size: 1.1rem; }
.list-toolbar .supporting-text { margin-top: 0.2rem; font-size: 0.82rem; }

.list-filters {
  width: min(100%, 37rem);
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 10rem;
  gap: 0.7rem;
}

.list-filters input,
.list-filters select { min-height: 2.7rem; font-size: 0.9rem; }
.row-actions { text-align: right; }

.table-action {
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
}

.table-action:hover { background: var(--warning-soft); }
.table-action-link { display: inline-flex; align-items: center; text-decoration: none; }

.form-dialog {
  width: min(calc(100% - 2rem), 43rem);
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.form-dialog::backdrop { background: rgba(15, 16, 18, 0.68); }
.form-dialog form { padding: clamp(1.2rem, 3vw, 2rem); }
.form-dialog-wide { width: min(calc(100% - 2rem), 68rem); }
.form-dialog-small { width: min(calc(100% - 2rem), 34rem); }
.grade-dialog-content { padding: clamp(1.2rem, 3vw, 2rem); }

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dialog-header h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
}

.dialog-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field-span-2 { grid-column: span 2; }

.variation-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #f7f6f2;
}

.variation-form input { min-height: 2.7rem; }
.variation-form .button { min-height: 2.7rem; white-space: nowrap; }
.grade-table-wrap { margin-top: 1rem; }
.stock-low-text { color: var(--danger); font-weight: 600; }
.product-actions { min-width: 12rem; }

.stock-metrics { margin-bottom: 1rem; }
.stock-status-normal { color: var(--success); background: #edf8f2; }
.stock-status-baixo { color: #70510f; background: var(--warning-soft); }
.stock-status-zerado { color: var(--danger); background: var(--danger-soft); }
.stock-status-inativo { color: var(--muted); background: #eeede9; }
.movement-positive { color: var(--success); font-weight: 600; }
.movement-negative { color: var(--danger); font-weight: 600; }
.movement-balance { color: var(--muted); font-size: 0.78rem; }
.stock-report-actions { display: flex; gap: 0.7rem; }
.stock-history-header { margin-bottom: 1rem; }
.stock-history-header h2 { margin: 0; font-size: 1.1rem; }
.stock-recent-card { margin-top: 1rem; }

.price-form {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(10rem, 0.35fr) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #f7f6f2;
}

.price-form input,
.price-form select,
.price-form .button { min-height: 2.7rem; }

.searchable-field { display: grid; gap: 0.45rem; min-width: 0; }
.searchable-field input[type="search"] { min-height: 2.7rem; background: #fbfaf7; }
.searchable-field select { min-height: 2.7rem; }

.romaneio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  align-items: start;
  gap: 1rem;
}

.romaneio-workspace { min-width: 0; display: grid; gap: 1rem; }
.product-picker { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(11rem, 0.35fr); gap: 1rem; }
.field-help { min-height: 1rem; color: var(--accent-dark); font-size: 0.75rem; font-weight: 400; }

.grade-builder-empty {
  margin-top: 1rem;
  padding: 2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.65rem;
  color: var(--muted);
  text-align: center;
}

.grade-builder { margin-top: 1rem; }
.grade-builder table { min-width: 32rem; }
.grade-builder th:not(:first-child),
.grade-builder td:not(:first-child) { text-align: center; }
.grade-quantity { width: 4.5rem; min-height: 2.5rem; padding: 0.4rem; text-align: center; }
.cart-quantity { width: 4.8rem; min-height: 2.3rem; padding: 0.35rem; text-align: center; }
.cart-price { width: 6.8rem; min-height: 2.3rem; padding: 0.35rem; text-align: right; }
.grade-stock { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.7rem; white-space: nowrap; }
.grade-unavailable { color: var(--line); }
.inline-actions { display: flex; justify-content: flex-end; margin-top: 0.8rem; }

.order-summary { position: sticky; top: 1rem; }
.order-summary h2 { margin: 0; font-family: "Playfair Display", serif; font-size: 1.6rem; }
.order-summary dl { margin: 1.5rem 0; }
.order-summary dl div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #ecebe7; }
.order-summary dt { color: var(--muted); }
.order-summary dd { margin: 0; font-weight: 600; }
.order-summary .summary-total { margin-top: 0.4rem; padding-top: 1rem; font-size: 1.1rem; border-bottom: 0; }
.order-summary .button + .button { margin-top: 0.6rem; }
.button-ghost { color: var(--muted); background: transparent; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

/* Documento de romaneio --------------------------------------------------- */

.document-page { background: #ebeae6; }

.document-toolbar {
  width: min(calc(100% - 2rem), 58rem);
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.document-toolbar-actions { display: flex; gap: 0.7rem; }
.document-toolbar .button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.document-sheet {
  width: min(calc(100% - 2rem), 58rem);
  min-height: 70rem;
  margin: 0 auto 2rem;
  padding: clamp(1.5rem, 4vw, 3.2rem);
  background: #ffffff;
  box-shadow: 0 16px 50px rgba(23, 25, 28, 0.12);
}

.document-error { width: min(calc(100% - 2rem), 58rem); margin: 2rem auto; }

.document-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.document-brand { display: flex; align-items: center; gap: 1rem; }
.document-brand .brand-mark { border-color: var(--line); }
.document-brand h1 { margin: 0; font-family: "Playfair Display", serif; font-size: 2rem; }
.document-brand p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.78rem; }

.document-number { text-align: right; }
.document-number span { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.document-number strong { display: block; margin: 0.2rem 0 0.5rem; font-size: 2rem; }

.document-section { margin-top: 1.7rem; }
.document-section-title { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.document-client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.document-field { min-height: 4.2rem; padding: 0.75rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.document-field:nth-child(2n) { border-right: 0; }
.document-field:nth-last-child(-n + 2) { border-bottom: 0; }
.document-field span { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; }
.document-field strong { font-size: 0.88rem; font-weight: 500; white-space: normal; }

.document-items { overflow: visible; }
.document-items table { table-layout: fixed; }
.document-items th,
.document-items td { padding: 0.65rem 0.45rem; white-space: normal; }
.document-items th:nth-child(1) { width: 12%; }
.document-items th:nth-child(2) { width: 28%; }
.document-items th:nth-child(3),
.document-items th:nth-child(4) { width: 13%; }
.document-items th:nth-child(5) { width: 10%; }
.document-items th:nth-child(6),
.document-items th:nth-child(7) { width: 12%; }

.document-summary { width: min(100%, 21rem); margin: 1.2rem 0 0 auto; }
.document-summary div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; }
.document-summary .document-total { margin-top: 0.4rem; padding-top: 0.8rem; border-top: 2px solid var(--ink); font-size: 1.1rem; }
.document-summary dt { color: var(--muted); }
.document-summary dd { margin: 0; font-weight: 600; }

.document-notes { min-height: 4.5rem; padding: 0.8rem; border: 1px solid var(--line); color: var(--ink-soft); font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap; }

.document-footer { margin-top: 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.signature-line { padding-top: 0.5rem; border-top: 1px solid var(--ink); color: var(--muted); font-size: 0.72rem; text-align: center; }
.document-disclaimer { margin: 2.5rem 0 0; color: var(--muted); font-size: 0.68rem; text-align: center; }

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

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .variation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .variation-form .button { width: 100%; }
  .romaneio-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
}

@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 1.25rem; }
  .brand-copy { margin: 4rem 0; }
  .brand-copy h1 { font-size: 2.5rem; }
  .brand-footer { display: none; }
  .login-panel { min-height: auto; padding: 2.5rem 1.25rem; }

  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: 0.8rem 1rem; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
  .sidebar-brand .brand-mark { width: 2rem; height: 2rem; }
  .sidebar-nav { width: 100%; margin: 0; display: flex; order: 3; overflow-x: auto; }
  .sidebar-nav .nav-item-muted { display: none; }
  .nav-item.active { min-height: 2.4rem; }
  .logout-button { min-height: 2.4rem; margin: 0 0 0 auto; padding: 0 0.8rem; }
  .dashboard-header { align-items: flex-start; }
  .page-header-actions { align-items: flex-start; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .list-filters { width: 100%; }
  .price-form { grid-template-columns: 1fr 1fr; }
  .price-form .button { grid-column: span 2; }
}

@media (max-width: 520px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .metric-card { padding: 0.9rem; }
  .metric-card strong { font-size: 1.55rem; }
  .user-chip span:last-child { display: none; }
  .sidebar-brand > span:last-child { display: none; }
  .dashboard-main { padding: 1rem; }
  .dashboard-header { margin-bottom: 1.3rem; }
  .content-card { padding: 0.9rem; }
  .page-header-actions { flex-direction: column; }
  .page-header-actions .button { width: 100%; }
  .list-filters { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .variation-form { grid-template-columns: 1fr; }
  .price-form,
  .product-picker { grid-template-columns: 1fr; }
  .price-form .button { grid-column: span 1; width: 100%; }
  .inline-actions .button { width: 100%; }
  .stock-report-actions { width: 100%; }
  .stock-report-actions .button { width: 100%; }
  .document-toolbar { align-items: stretch; flex-direction: column; }
  .document-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .document-sheet { width: 100%; min-height: 0; margin-bottom: 0; padding: 1rem; box-shadow: none; }
  .document-header { grid-template-columns: 1fr; gap: 1rem; }
  .document-number { text-align: left; }
  .document-client-grid { grid-template-columns: 1fr; }
  .document-field,
  .document-field:nth-child(2n),
  .document-field:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .document-field:last-child { border-bottom: 0; }
  .document-footer { gap: 1.5rem; }
}

@page { size: A4 portrait; margin: 12mm; }

@media print {
  :root { background: #ffffff; }
  .document-page { background: #ffffff; }
  .no-print,
  .page-loading { display: none !important; }
  .document-sheet {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  .document-header { break-inside: avoid; }
  .document-section { break-inside: auto; }
  .document-items thead { display: table-header-group; }
  .document-items tr { break-inside: avoid; }
  .document-summary,
  .document-notes,
  .document-footer { break-inside: avoid; }
  .status-badge { border: 1px solid currentColor; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.table-pagination { display:flex; gap:1rem; align-items:center; justify-content:flex-end; padding:1rem; }
.table-pagination button { padding:.5rem 1rem; cursor:pointer; }
.search-limit-hint { display:block; margin-top:.4rem; color:#755121; }
