/* Vinitto: brand turquoise, cool neutrals and layouts designed for touch. */
:root {
  color-scheme: light;
  --brand: #52b6b2;
  --brand-hover: #4fb0ad;
  --brand-soft: #e7f6f5;
  --brand-ink: #14666c;
  --ink: #203b49;
  --muted: #58717d;
  --border: #dce8ed;
  --surface: #ffffff;
  --canvas: #f3f8fa;
  --green: var(--brand-ink);
  background: var(--canvas);
  color: var(--ink);
}
html { scroll-padding-block: 24px; }
body { background: var(--canvas); line-height: 1.5; }
button, a, input, select, textarea { touch-action: manipulation; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #25888d;
  outline-offset: 3px;
}
.sidebar { border-color: var(--border); }
.brand span, .nav-label, .sidebar-bottom, .sidebar-bottom small { color: var(--muted); }
.brand img { width: 142px; height: 51px; }
nav a { min-height: 48px; color: var(--muted); border-radius: 10px; gap: 13px; }
nav a svg { width: 21px; height: 21px; flex: 0 0 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav a.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 3px 0 var(--brand); }
nav a:hover { background: #eff8fa; color: var(--brand-ink); }
nav b { background: #cfeeea; color: #174f55; }
.connection-dot { background: var(--brand-ink); }
.topbar { border-color: var(--border); color: var(--muted); }
#breadcrumb { color: var(--ink); font-weight: 600; }
.environment { color: #506a77; background: #f1f7fa; border-color: var(--border); }
.panel { border-color: var(--border); border-radius: 14px; }
.page-heading { margin-bottom: 26px; }
h1 { color: #193b4b; font-size: 31px; letter-spacing: -1px; }
.eyebrow { color: var(--brand-ink); letter-spacing: 1.7px; }
.subtitle, .panel-heading p, .form-hint, .modal-heading p:not(.eyebrow) { color: var(--muted); }
.primary, .secondary { border-radius: 9px; min-height: 46px; font-size: 13px; line-height: 1.4; }
.primary { background: var(--brand); color: #103b42; border: 1px solid transparent; font-weight: 700; }
.primary:hover { background: var(--brand-hover); color: #103b42; }
.secondary { background: white; color: var(--brand-ink); border: 1px solid #bdd6dd; }
.secondary:hover { background: var(--brand-soft); border-color: #8bc4c5; }
.text-button, .subtle-link { color: var(--brand-ink); }
.icon-button { color: var(--brand-ink); border-radius: 8px; }
.icon-button:hover { background: var(--brand-soft); }
.demo-note { color: #425f70; background: #eaf3fa; border-color: #d1e3ef; border-radius: 9px; }
.stat { border-color: var(--border); border-radius: 12px; }
.stat:hover { background: #f5fbfc; border-color: #8fc8c9; }
.stat > span, .stat small { color: var(--muted); }
.stat strong { color: #1c4454; }
.stat.teal i { background: var(--brand-soft); color: var(--brand-ink); }
.stat.blue i { background: #e9f0fc; color: #466ba5; }
.count, .type-tag { background: #edf5f8; color: #456578; }
.operational-summary { color: var(--muted); }
.operational-summary strong { color: #244c5d; }
thead, .list-summary { background: #f4f8fb; }
th, .nowrap { color: #527080; }
td { border-color: #e8f0f3; }
.cell-sub { color: #5b7280; }
.status { border-radius: 7px; font-size: 12px; }
.pendiente { background: #fff3d6; color: #80601c; }
.preparando { background: #e1f4f1; color: #1d6963; }
.enviado { background: #e8effd; color: #3d619d; }
.entregado { background: #eaf1f3; color: #4c6570; }
.toolbar { gap: 14px; }
.filter-label, .form-grid label { color: #365d6e; }
.result-count, .list-summary { color: var(--muted); }
input, select, textarea { border-color: #c9dce3; border-radius: 8px; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #647c89; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #25888d; }
input[readonly] { color: #536d7b; background: #eef5f8; }
.search-wrap input { background: #f8fbfd; }
.search-wrap > span { color: #50798a; }
.client-card { border-color: var(--border); border-radius: 12px; }
.avatar { background: var(--brand-soft); color: var(--brand-ink); }
.client-card p, .client-card .client-code, .client-card-bottom { color: var(--muted); }
.client-card h2 .text-button { overflow-wrap: anywhere; }
.stock-card { border-color: var(--border); border-radius: 12px; }
.stock-card .client-code, .stock-quantities dt { color: var(--muted); }
.stock-quantities .available { color: var(--brand-ink); }
.stock-badge { background: var(--brand-soft); color: var(--brand-ink); }
.stock-badge.stock-low { background: #fff1db; color: #855515; }
.stock-policy, .record-summary, .document-totals, .repeat-note, .order-total, .backup-export {
  background: #edf8f8;
  border-color: #cfe5e8;
  color: #285461;
  border-radius: 10px;
}
.stock-policy p, .record-summary span, .document-totals span, .order-total span, .order-total small, .backup-export p { color: #456b78; }
.stock-movement p, .movement-deltas time, .timeline p, .timeline time { color: var(--muted); }
.delivery-label { color: #5b7280; }
.delivery-label.overdue { color: #a43d30; }
.detail-grid dt { color: #527080; }
.order-detail-status { background: #eff6f9; }
legend { color: #285664; }
.form-grid, .form-grid > *, .detail-grid > *, .page-heading > *, .toolbar > *, .delivery-card > * { min-width: 0; }
.form-grid label, .form-hint, .text-button { overflow-wrap: anywhere; }
.form-error { color: #923a30; background: #fff0ec; border-color: #b95847; }
dialog { color: var(--ink); border-color: var(--border); border-radius: 16px; scroll-padding-block: 100px; }
dialog::backdrop { background: #173b4d80; backdrop-filter: blur(4px); }
body:has(dialog[open]) { overflow: hidden; }
.modal-heading { gap: 16px; }
.modal-heading h2 { color: #1d4557; }
.form-actions { background: white; }
.process li { color: var(--muted); }
.process li::before { background: #dce9ed; }
.process li > span { background: #f1f7f9; border-color: #cfdee5; }
.process li.complete::before { background: var(--brand); }
.process li.complete > span { background: var(--brand-soft); border-color: #86c8c4; color: var(--brand-ink); }
.process li.current, .process li.current > span { color: #103b42; }
.process li.current > span { background: var(--brand); border-color: var(--brand); }
.timeline li { border-color: #cce5e7; }
.timeline li::before { background: var(--brand-ink); }
.brand-strip { background: #e9f5f6; border-color: #d2e8ec; }
.brand-strip p:not(.eyebrow) { color: #4c7180; }
.delivery-card p { color: var(--muted); }
.delivery-preview { background: #edf3f6; border-color: var(--border); }
.delivery-preview svg { border-color: #edf3f6; }
.delivery-preview.is-zoomed svg { min-width: 740px; }
#toast { background: #194c5c; border-radius: 10px; font-size: 13px; line-height: 1.6; padding: 14px 20px; }
footer { color: #617b89; }
.delivery-email-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e6f6f2;
  border: 1px solid #99decb;
  color: #125e4c;
  padding: 12px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}
.email-attachment-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f6f8;
  border: 1px solid #d3e5ea;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #2b5563;
  margin: 16px 0;
}
.email-tag {
  background: #e6f6f2 !important;
  color: #166e5a !important;
  border: 1px solid #b6e8db;
}
.crm-alert-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fdf8eb;
  border: 1px solid #ebd89e;
  color: #795713;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.crm-alert-box p { margin: 0; font-size: 13px; line-height: 1.5; }
.crm-alert-box strong { color: #573d09; }
.crm-inactive-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #925c11;
  background: #fef3d6;
  border: 1px solid #ebd08d;
  padding: 2px 7px;
  border-radius: 12px;
  margin-left: 6px;
}
.label-mockup-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at center, #ffffff 0%, #edf5f7 100%);
  border: 1px solid #d0e4e8;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0 24px;
}
.bottle-mockup-svg {
  filter: drop-shadow(0 12px 18px rgba(22, 60, 66, 0.12));
  max-height: 320px;
  width: auto;
}
.mockup-caption {
  font-size: 11px;
  color: #557987;
  margin-top: 10px;
  text-align: center;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(18, 56, 64, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(18, 56, 64, 0.06);
}
.kpi-card span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.kpi-card strong { font-size: 26px; font-weight: 800; color: #1c4454; display: block; line-height: 1.1; }
.kpi-card small { display: block; font-size: 11.5px; color: #587986; margin-top: 6px; }

/* Dashboard Hero & Quick Actions */
.dashboard-hero {
  background: linear-gradient(135deg, #114c52 0%, #165b63 60%, #1d727b 100%);
  color: white;
  padding: 24px 28px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: 0 10px 25px rgba(18, 77, 84, 0.18);
}
.dashboard-hero-title h1 {
  color: white;
  font-size: 26px;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
}
.dashboard-hero-title p {
  color: #c4e9e7;
  font-size: 13.5px;
  margin: 0;
}
.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-hero-actions .hero-btn-primary {
  background: var(--brand);
  color: #0b373d;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 18px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
}
.dashboard-hero-actions .hero-btn-primary:hover {
  background: #6fe1dd;
  transform: translateY(-1px);
}
.dashboard-hero-actions .hero-btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.dashboard-hero-actions .hero-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Mix visual de vino */
.wine-mix-bar-wrap {
  margin-top: 8px;
}
.wine-mix-bar {
  display: flex;
  height: 9px;
  border-radius: 6px;
  overflow: hidden;
  background: #e4edf0;
}
.wine-mix-white {
  background: #e5cd68;
  height: 100%;
}
.wine-mix-red {
  background: #751e2b;
  height: 100%;
}
.wine-mix-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #557785;
  margin-top: 6px;
  font-weight: 600;
}

/* Dashboard Bento Grid (2 columns: Main Orders & Side Warehouse) */
.dashboard-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 20px;
  margin-bottom: 26px;
  align-items: start;
}
.bento-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(18, 56, 64, 0.03);
  overflow: hidden;
}
.bento-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid #edf4f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bento-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1a4252;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bento-card-header p {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0 0;
}
.bento-card-body {
  padding: 18px 22px;
}

/* Stock mini widget */
.stock-mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stock-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f7fafc;
  border: 1px solid #e5eff2;
  border-radius: 10px;
  transition: all 0.15s ease;
}
.stock-mini-item:hover {
  background: #eef7f9;
  border-color: #bfe0e4;
}
.stock-mini-name strong {
  display: block;
  font-size: 13.5px;
  color: #173d4c;
}
.stock-mini-name small {
  font-size: 11px;
  color: #5d7e8b;
}
.stock-mini-numbers {
  text-align: right;
}
.stock-mini-numbers strong {
  font-size: 17px;
  color: #14666c;
  font-weight: 800;
}
.stock-mini-numbers small {
  display: block;
  font-size: 10.5px;
  color: #63828e;
}

/* Integration shortcut cards */
.integration-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.integration-card {
  padding: 14px;
  background: #edf7f6;
  border: 1px solid #c9e6e3;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.integration-card:hover {
  background: #e0f2f0;
  transform: translateY(-1px);
}
.integration-card span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #125e64;
  margin-bottom: 2px;
}
.integration-card strong {
  font-size: 13px;
  color: #103b42;
  display: block;
}
.integration-card small {
  font-size: 10.5px;
  color: #4b747b;
}

/* Badge de personalización de botellín */
.tag-custom {
  background: #fef4df;
  color: #92580e;
  border: 1px solid #fae2b1;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag-standard {
  background: #f0f5f8;
  color: #557280;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
}

.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; padding: 12px 18px; border-radius: 8px; background: var(--brand); color: #103b42; }
.skip-link:focus { top: 12px; }

@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) {
  html { scroll-padding-block: 80px; }
  .sidebar { position: static; width: 100%; display: block; padding: 12px 20px; background: white; border-bottom: 1px solid var(--border); }
  .brand { display: flex; align-items: center; justify-content: space-between; padding: 0; gap: 20px; }
  .nav-label, .sidebar-bottom { display: none; }
  .brand img { width: 112px; height: 40px; }
  .brand span { color: #557a89; font-size: 9px; letter-spacing: 1.2px; }
  .sidebar nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 3px;
    padding: 7px max(9px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left));
    background: #ffffff;
    border-top: 1px solid #d3e5ea;
    box-shadow: 0 -5px 24px #244f6010;
  }
  .sidebar nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-wrap: nowrap; min-height: 55px; padding: 6px 1px; gap: 5px; font-size: 11px; line-height: 1.2; color: #516e7d; border-radius: 10px; }
  .sidebar nav a.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
  .sidebar nav a svg { display: block; width: 21px; height: 21px; }
  .sidebar nav b { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; border: 2px solid white; border-radius: 12px; padding: 2px 4px; min-width: 17px; font-size: 9px; line-height: 1; }
  .workspace { margin: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar { height: 43px; padding: 0 20px; font-size: 12px; background: var(--canvas); border-bottom: 0; }
  .topbar-actions .text-button { min-height: 40px; font-size: 12px; }
  main { padding: 16px 16px 24px; min-height: calc(100dvh - 230px); }
  .page-heading { gap: 16px; margin-bottom: 22px; flex-wrap: wrap; align-items: flex-start; }
  .page-heading .eyebrow { display: none; }
  .page-heading h1 { font-size: 27px; line-height: 1.2; margin-bottom: 10px; }
  .subtitle { font-size: 14px; line-height: 1.6; }
  .page-heading > .primary { min-height: 48px; font-size: 14px; }
  .page-heading > .document-actions { width: 100%; }
  .primary, .secondary { font-size: 14px; min-height: 48px; padding: 12px 16px; white-space: normal; }
  .text-button { min-height: 44px; line-height: 1.5; }
  .demo-note { font-size: 12px; padding: 12px; gap: 8px; margin-bottom: 20px; }
  .stats { gap: 12px; margin-bottom: 24px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dashboard-bento { grid-template-columns: 1fr; gap: 16px; }
  .dashboard-hero { padding: 18px 20px; }
  .stat { padding: 14px 15px; }
  .stat > span { font-size: 12px; }
  .stat strong { font-size: 31px; margin: 9px 0 0; line-height: 1.2; }
  .stat small { display: none; }
  .stat i { height: 29px; width: 29px; font-size: 17px; }
  main:has(.stats) { display: flex; flex-direction: column; }
  main:has(.stats) > .page-heading { order: 0; }
  main:has(.stats) > .demo-note { order: 1; }
  main:has(.stats) > .stats { order: 2; }
  main:has(.stats) > .panel { order: 3; }
  main:has(.stats) > .operational-summary { order: 4; margin: 20px 0; }
  main:has(.stats) > .stock-alert { order: 5; }
  main:has(.stats) > .brand-strip { order: 6; }
  .operational-summary { font-size: 12px; line-height: 1.6; margin-bottom: 20px; }
  .stock-alert { padding: 12px 14px; gap: 6px; font-size: 12px; }
  .panel-heading { padding: 18px 16px; gap: 8px; }
  .panel-heading h2 { font-size: 17px; }
  .panel-heading p { font-size: 12px; line-height: 1.6; }
  .toolbar { padding: 16px; gap: 12px; align-items: stretch; }
  .toolbar .filter-label { flex: 1 1 calc(50% - 12px); font-size: 12px; }
  input, select, textarea { font-size: 16px; min-height: 48px; padding: 12px; }
  input[type=date] { appearance: none; -webkit-appearance: none; min-width: 0; width: 100%; }
  .search-wrap input { padding-left: 38px; }
  .list-summary { padding: 9px 16px; flex-wrap: wrap; gap: 6px; }
  .table-wrap { background: #f4f8fa; }
  .table-wrap tbody { display: grid; padding: 12px; gap: 12px; }
  .table-wrap tr { border: 1px solid var(--border); border-radius: 11px; background: white; padding: 12px 16px; gap: 4px 10px; }
  .table-wrap td { padding: 5px 0; font-size: 14px; }
  .table-wrap td:nth-child(2) { border-color: #e1ecf0; padding-bottom: 12px; }
  .table-wrap td:nth-child(3)::before, .table-wrap td:nth-child(4)::before { font-size: 10px; color: #5c7684; letter-spacing: .7px; margin: 2px 0 5px; }
  .table-wrap td:nth-child(3) { font-size: 12px; }
  .table-wrap td:nth-child(4) { font-size: 16px; }
  .table-wrap td:nth-child(6) .icon-button { min-width: 48px; min-height: 48px; background: var(--brand-soft); }
  .table-wrap .status { min-height: 48px; font-size: 14px; max-width: 100%; }
  .table-wrap .order-link { min-height: 38px; font-size: 15px; }
  .table-wrap .cell-sub { font-size: 12px; line-height: 1.6; }
  .delivery-label { font-size: 11px; }
  .client-grid, .stock-grid { padding: 12px; gap: 12px; }
  .client-card, .stock-card { padding: 18px; }
  .client-card p { font-size: 13px; }
  .client-card-bottom { gap: 12px; }
  .stock-quantities dt { font-size: 12px; }
  .stock-quantities dd { font-size: 27px; }
  .stock-card-actions { gap: 9px; }
  .stock-card-actions .primary, .stock-card-actions .secondary { padding-inline: 10px; }
  .stock-movement { padding: 18px 16px; }
  .movement-deltas { font-size: 13px; }
  .delivery-card { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; padding: 18px 16px; }
  .delivery-card > div:last-child { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .delivery-card strong { font-size: 20px; }
  .document-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .document-actions > * { min-width: 0; }
  .document-actions .text-button { padding: 8px; text-align: center; }
  .document-totals { padding: 14px 12px; gap: 9px; }
  .document-totals strong { font-size: 18px; }
  .document-totals span { font-size: 11px; }
  .delivery-preview { max-height: 60dvh; }
  .brand-strip > div { padding: 18px; }
  .brand-strip img { width: 27%; align-self: stretch; min-height: 150px; height: auto; }
  footer { padding: 12px 18px; font-size: 10px; line-height: 1.7; }
  dialog {
    inset: 0;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0 20px max(20px,env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    overscroll-behavior: contain;
    scroll-padding-block: 110px;
  }
  dialog::backdrop { backdrop-filter: none; }
  .modal-heading { position: sticky; top: 0; z-index: 3; padding: max(20px,env(safe-area-inset-top)) 0 18px; margin: 0 0 24px; background: white; border-bottom: 1px solid var(--border); align-items: flex-start; }
  .modal-heading h2 { font-size: 24px; }
  .modal-heading .eyebrow { margin-bottom: 9px; font-size: 10px; }
  .modal-heading p:not(.eyebrow) { font-size: 12px; line-height: 1.6; }
  .modal-heading .icon-button { flex: 0 0 44px; background: #eef6f8; }
  .form-grid { gap: 18px; }
  .form-grid label, .filter-label { font-size: 13px; }
  fieldset { margin-bottom: 26px; padding-top: 20px; }
  legend { font-size: 14px; }
  .form-hint { font-size: 12px; line-height: 1.7; }
  .form-actions { position: sticky; bottom: calc(-1 * max(20px,env(safe-area-inset-bottom))); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 10px; padding: 16px 0 max(20px,env(safe-area-inset-bottom)); background: white; border-color: var(--border); z-index: 2; }
  .form-actions > :only-child { grid-column: 1/-1; }
  .form-actions > * { min-width: 0; }
  .detail-actions { gap: 10px; }
  .detail-actions .secondary { flex: 1 1 140px; }
  .detail-actions .text-button { text-align: center; }
  .order-detail-status { font-size: 14px; padding: 14px; }
  .detail-grid dd { font-size: 15px; }
  .process li { font-size: 12px; }
  .process li > span { width: 34px; height: 34px; }
  .process li::before { top: 16px; }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); left: 16px; right: 16px; max-width: none; transform: translateY(10px); }
  #toast.visible { transform: translateY(0); }
  body:has(dialog[open]) #toast { bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 10; }
}
@media (max-width: 360px) {
  main { padding-inline: 12px; }
  .sidebar { padding-inline: 16px; }
  .sidebar nav a { font-size: 10px; }
  dialog { padding-inline: 16px; }
  .document-totals { padding-inline: 10px; }
  .document-totals strong { font-size: 16px; }
  .toolbar .filter-label { flex-basis: 100%; }
}
@media (max-width: 960px) and (max-height: 500px) {
  .sidebar { padding-block: 7px; }
  .sidebar nav { padding-block: 4px; }
  .sidebar nav a { min-height: 43px; flex-direction: row; gap: 6px; }
  .sidebar nav a svg { width: 17px; height: 17px; flex-basis: 17px; }
  .workspace { padding-bottom: 65px; }
  .modal-heading { position: relative; padding-block: 14px; }
  .form-actions { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
