:root {
  --ink: #1B1C1A;
  --muted: #6F665C;
  --paper: #F4F1E8;
  --panel: #FFFDF8;
  --line: #D8CEC0;
  --brand: #D85A16;
  --brand-dark: #8A2F0F;
  --brand-header: #B14513;
  --gold: #D49A1E;
  --teal: #946F53;
  --green: #109439;
  --blue: #3B3A34;
  --danger: #9D3324;
  --brick: #946F53;
  --radius: 8px;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  min-height: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: var(--brand-header);
  color: #fff;
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  min-width: 220px;
}
.brand-mark {
  width: 69px;
  height: 69px;
  display: grid;
  place-items: center;
  color: #d8d2ca;
}
.brand-mark img {
  width: 66px;
  height: 66px;
  display: block;
  object-fit: contain;
}
.brand strong { font-size: 24px; line-height: 1; }
.brand small { display: block; color: rgba(255,255,255,.78); }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.nav a, .session-chip {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-weight: 800;
  font-size: 14px;
}
.session-chip {
  min-width: 126px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}
.session-chip strong { font-weight: 800; }
.session-chip span {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 400;
}

.shell {
  width: min(1440px, calc(100% - 28px));
  margin: 18px auto 0;
  padding-bottom: 40px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.flash {
  background: #F6E6CE;
  border: 1px solid #E4C489;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(27, 28, 26, .08);
}
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.kpi b { display: block; font-size: 26px; margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.teal { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.full { width: 100%; }
.btn:disabled,
.btn.disabled,
.btn[aria-disabled="true"],
button:disabled {
  background: #D8D0C4 !important;
  border-color: #C7BCAD !important;
  color: #81786D !important;
  cursor: not-allowed;
  box-shadow: none;
  opacity: .72;
  transform: none;
}
.btn:disabled:hover,
.btn.disabled:hover,
.btn[aria-disabled="true"]:hover {
  transform: none;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: #E9E1D6 !important;
  color: #81786D !important;
  border-color: #C7BCAD !important;
  cursor: not-allowed;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.space { justify-content: space-between; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.grid-form .span-12 { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; margin-bottom: 10px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 900; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
}
.field textarea { min-height: 78px; resize: vertical; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}
.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  vertical-align: middle;
}
.order-detail-panel {
  max-width: 100%;
}
.table th {
  background: #EFE2D2;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.cell-text,
.report-text {
  text-align: left !important;
}
.cell-number,
.cell-money,
.cell-date,
.cell-status,
.cell-action {
  text-align: center;
}
.cell-money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.badge.green { background: var(--green); }
.badge.gold { background: var(--gold); color: #1B1C1A; }
.badge.blue { background: var(--blue); }
.badge.red { background: var(--danger); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.tile {
  min-height: 108px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  align-content: space-between;
  text-decoration: none;
}
.tile.busy { border-color: rgba(182,83,31,.42); background: #FFF1E8; }
.tile.account { border-color: rgba(212,154,30,.58); background: #FFF7DF; }
.tile strong { font-size: 18px; }
.table-map {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}
.table-map .tile:nth-last-child(2):nth-child(4n + 1) {
  grid-column: 2;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.product-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 10px;
}
.product-card button { margin-top: 8px; }

@media (max-width: 1280px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
}
.product-name {
  display: -webkit-box;
  min-height: 3.75em;
  line-height: 1.25;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}
.qty-control {
  display: grid;
  grid-template-columns: 46px minmax(58px, 1fr) 46px;
  gap: 6px;
  align-items: center;
  margin: 10px 0;
}
.qty-control input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-weight: 900;
}
.qty-btn {
  min-height: 46px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}
.quick-actions-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(220px, 2fr);
  gap: 10px;
  align-items: end;
}
.quick-actions-row form {
  margin: 0;
}
@media (max-width: 700px) {
  .quick-actions-row {
    grid-template-columns: 1fr;
  }
}
body.login-page .shell {
  width: min(420px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}
.login {
  min-height: calc(100dvh - 68px);
  display: grid;
  place-items: center;
  padding: 14px 0;
}
.login .card {
  width: 100%;
}
.ticket {
  background: #fff;
  border: 1px dashed #946F53;
  border-radius: var(--radius);
  padding: 14px;
}
.print-only { display: none; }

@media print {
  body { height: auto; overflow: visible; display: block; }
  .topbar, .nav, .no-print, .flash { display: none !important; }
  .shell { width: 100%; margin: 0; padding: 0; overflow: visible; height: auto; }
  .card { box-shadow: none; border: 0; }
  .print-only { display: block; }
}

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { margin-left: 0; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

.ticket-page {
  display: grid;
  justify-content: center;
}
.thermal-ticket {
  width: 320px;
  max-width: 100%;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 14px;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  line-height: 1.28;
}
.thermal-ticket h1 {
  font-size: 20px;
  margin: 0 0 4px;
}
.thermal-ticket p {
  margin: 4px 0;
}
.thermal-ticket hr {
  border: 0;
  border-top: 1px dashed #333;
  margin: 9px 0;
}
.ticket-center {
  text-align: center;
}
.ticket-lines {
  width: 100%;
  border-collapse: collapse;
}
.ticket-lines td {
  padding: 4px 0;
  vertical-align: top;
}
.ticket-lines td:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 8px;
}
.ticket-lines small {
  color: #444;
}
.ticket-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}

@media print {
  @page { margin: 4mm; }
  body { background: #fff; height: auto; overflow: visible; display: block; }
  .ticket-page { display: block; }
  .thermal-ticket {
    width: 72mm;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0 auto;
    font-size: 11px;
  }
  .thermal-ticket h1 { font-size: 16px; }
}
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}
.product-table input,
.product-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.product-table tr.is-muted {
  opacity: .62;
  background: #EFE6DA;
}
.product-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 10px;
}
.product-search input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
}
.category-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  overflow: visible;
  padding: 2px 0 10px;
  margin-bottom: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}
.chip small {
  color: var(--muted);
  font-weight: 800;
}
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip.active small {
  color: rgba(255,255,255,.82);
}
@media (max-width: 700px) {
  .product-search { grid-template-columns: 1fr; }
}
.invoice-form {
  display: grid;
  gap: 6px;
  min-width: 220px;
}
.invoice-form select,
.invoice-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.invoice-form textarea {
  min-height: 58px;
  resize: vertical;
}
.invoice-table td {
  vertical-align: top;
}
.user-table input,
.user-table select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.user-table tr.is-muted {
  opacity: .62;
  background: #EFE6DA;
}
.table-admin input,
.table-admin select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.table-admin tr.is-muted {
  opacity: .62;
  background: #EFE6DA;
}
.station-table input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.filter-row {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}
.history-search {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(120px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}
.history-search .field {
  margin-bottom: 0;
}
.history-results tr.is-selected {
  background: #FFF1E8;
  box-shadow: inset 4px 0 0 var(--brand);
}
.history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.history-summary div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}
.history-summary span,
.history-summary strong {
  display: block;
}
.history-summary strong {
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .history-search,
  .history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .history-search,
  .history-summary {
    grid-template-columns: 1fr;
  }
}
.compact-tiles {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}
.compact-table th, .compact-table td {
  padding: 8px;
}
.quick-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 900;
}
.quick-total strong {
  font-size: 26px;
}
.pay-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.quick-products {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.table tr.is-selected {
  background: #FFF1E8;
  box-shadow: inset 4px 0 0 var(--brand);
}
.split-balance {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  text-align: right;
}
.split-balance span,
.split-balance strong {
  display: block;
}
.split-balance strong {
  font-size: 22px;
}
.split-grid {
  margin-top: 12px;
}
.split-pay-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.split-pay-form .field {
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .split-pay-form {
    grid-template-columns: 1fr;
  }
  .split-balance {
    width: 100%;
    text-align: left;
  }
}

.split-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.split-setup .field {
  min-width: 190px;
  margin-bottom: 0;
}
.item-split-form {
  display: grid;
  grid-template-columns: 1fr 160px 180px;
  align-items: end;
}
.split-items {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}
.split-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}
.split-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
}
.split-item.is-paid {
  color: var(--muted);
  background: #F1ECE4;
  opacity: .76;
}
@media (max-width: 800px) {
  .table-map {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
  .table-map .tile:nth-last-child(2):nth-child(4n + 1) {
    grid-column: auto;
  }
  .item-split-form {
    grid-template-columns: 1fr;
  }
}

.kpi-link {
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease;
}
.kpi-link:hover {
  transform: translateY(-1px);
  border-color: rgba(221, 87, 16, .45);
}
.quick-order-card,
.tile.busy {
  position: relative;
}
.ready-check,
.state-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #109439;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(20, 46, 24, .22);
}
.tile-ready {
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  font-size: 14px;
}
.state-icon.state-ready { background: #109439; color: #fff; }
.state-icon.state-waiting { background: #E7E0D4; color: #56504A; }
.state-icon.state-preparing { background: #FFFDF8; color: var(--brand); border: 1px solid rgba(221, 87, 16, .45); }
.state-icon.state-charge { background: #E0A51A; color: #111; }
.state-icon.state-locked { background: #6F8A70; color: #fff; }
.state-icon.state-empty { background: #fff; color: #3B3834; border: 1px solid var(--line); }
.order-state-tile.state-ready { background: #EEF8EF; border-color: rgba(16, 148, 57, .45); }
.order-state-tile.state-waiting { background: #F5F3EF; border-color: rgba(86, 80, 74, .3); }
.order-state-tile.state-preparing { background: #FFF0E6; border-color: rgba(221, 87, 16, .45); }
.order-state-tile.state-charge { background: #FFF6D7; border-color: rgba(224, 165, 26, .55); }
.order-state-tile.state-locked { background: #EEF2EC; border-color: rgba(111, 138, 112, .5); }
.order-state-tile.state-empty { background: #FFFBF4; }
.production-filter-chip {
  position: relative;
  overflow: visible;
}
.filter-count {
  position: absolute;
  top: -9px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #B83224;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(32, 20, 14, .18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.order-items-status-table th,
.order-detail-table th {
  text-align: center;
}
.order-items-status-table .status-icon-head,
.order-items-status-table .status-icon-cell,
.order-detail-table .status-icon-head,
.order-detail-table .status-icon-cell {
  width: 44px;
  text-align: center;
}
.order-items-status-table .status-label-cell,
.order-detail-table .status-label-cell {
  width: 116px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.item-row-new td {
  background: #FFF8EC;
}
.item-row-new .status-icon-cell {
  background: transparent;
}
.item-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.item-state-icon-only {
  gap: 0;
}
.item-state-label {
  display: inline-block;
  line-height: 1.1;
}
.item-state-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #E7E0D4;
  color: #56504A;
  line-height: 1;
  box-shadow: 0 1px 5px rgba(25, 21, 17, .12);
}
.item-state-new .item-state-icon { background: #fff; color: #3B3834; border: 1px solid var(--line); }
.item-state-pending .item-state-icon { background: #E7E0D4; color: #56504A; }
.item-state-preparing .item-state-icon { background: #FFFDF8; color: var(--brand); border: 1px solid rgba(221, 87, 16, .45); }
.item-state-ready .item-state-icon { background: #109439; color: #fff; }
.item-state-charge .item-state-icon { background: #E0A51A; color: #111; }
.item-state-locked .item-state-icon { background: #6F8A70; color: #fff; }
.item-state-service .item-state-icon { background: #F7F0E6; color: #6F665C; border: 1px solid var(--line); }
.item-state-cancelled .item-state-icon { background: var(--danger); color: #fff; }
.product-card .qty-btn {
  margin-top: 0;
  align-self: center;
}
.qty-control input {
  align-self: center;
}
.order-detail-panel > .row.space:first-child {
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.order-detail-panel > .row.space:first-child .btn {
  margin-left: 12px;
}

.pedido-list {
  display: grid;
  gap: 14px;
}
.pedido-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}
.pedido-header h2 {
  margin: 0;
  font-size: 18px;
}
.pedido-card .table {
  margin-top: 10px;
}

.delivery-chart {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(216, 206, 192, .9);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #FFFDF8 0%, #F8F2E8 100%);
}
.delivery-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.delivery-chart-head h2 { margin-bottom: 2px; }
.delivery-chart-head p { margin: 0; }
.delivery-bars {
  min-height: 0;
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: center;
  overflow-x: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--line);
}
.delivery-bar-item {
  width: 82px;
  min-width: 82px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.delivery-bar-track {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 2px solid rgba(111, 102, 92, .22);
}
.delivery-bar {
  width: min(62px, 72%);
  min-height: 22px;
  border-radius: 7px 7px 4px 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 7px;
  color: #fff;
  box-shadow: 0 10px 18px rgba(27, 28, 26, .12);
}
.delivery-bar strong {
  font-size: 13px;
  line-height: 1;
}
.delivery-bar-1 { background: var(--brand); }
.delivery-bar-2 { background: var(--gold); color: var(--ink); }
.delivery-bar-3 { background: var(--green); }
.delivery-bar-4 { background: var(--teal); }
.delivery-bar-item span {
  max-width: 100%;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .delivery-chart-head { flex-direction: column; }
  .delivery-bars { gap: 8px; }
}
.delivery-summary-filter {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.delivery-summary-filter .field {
  width: 142px;
  margin-bottom: 0;
}
.delivery-summary-filter .btn {
  margin-bottom: 0;
}
.no-access {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

.production-hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.production-hero h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}
.production-hero p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}
.production-refresh-box {
  display: grid;
  gap: 4px;
  justify-items: end;
}
.production-refresh-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.production-refresh {
  min-height: 42px;
  min-width: 136px;
  font-size: 17px;
}
.production-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.production-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  grid-auto-rows: 520px;
}
.production-card {
  height: 520px;
  min-height: 520px;
  border: 2px solid rgba(216, 206, 192, .95);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(25, 21, 17, .08);
  display: flex;
  flex-direction: column;
}
.production-card.status-pendiente {
  border-color: rgba(157, 51, 36, .72);
  background: #FFF4EA;
  box-shadow: 0 0 0 2px rgba(157, 51, 36, .08), 0 10px 24px rgba(157, 51, 36, .12);
}
.production-card.status-impreso {
  border-color: rgba(217, 157, 18, .62);
  background: #FFFDF8;
}
.production-card.status-listo {
  border-color: rgba(16, 148, 57, .5);
  opacity: .86;
}
.production-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.production-card-head > div {
  min-width: 0;
  flex: 1 1 auto;
}
.production-card-head > .badge {
  flex: 0 0 auto;
}
.production-station {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}
.status-pendiente .production-station {
  background: var(--danger);
}
.production-card.status-pendiente .badge {
  background: var(--gold);
  color: var(--ink);
}
.status-impreso .production-station {
  background: var(--brick);
}
.production-card.status-impreso .badge {
  background: var(--green);
  color: #fff;
}
.status-listo .production-station {
  background: var(--green);
}
.production-card h2 {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(24px, 2vw, 28px);
  line-height: 1.08;
}
.production-card h2 span {
  white-space: nowrap;
}
.production-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 17px;
}
.production-delivery,
.production-note {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed rgba(111, 102, 92, .35);
  border-radius: 8px;
  background: #FFF8EC;
  font-size: 17px;
}
.production-lines {
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 2px;
}
.production-line {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FCFAF5;
}
.production-line strong {
  display: block;
  font-size: 25px;
  line-height: 1.16;
}
.production-line p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.production-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
}
.production-actions form {
  margin: 0;
  width: 100%;
}
.production-cancel {
  display: block;
}
.production-cancel textarea {
  min-height: 64px;
  resize: vertical;
  font-size: 18px;
}
.production-btn {
  width: 100%;
  min-height: 86px;
  font-size: 24px;
}
.production-ready-message,
.production-empty {
  font-size: 20px;
}
.production-ready-message {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 8px;
  background: rgba(46, 125, 50, .1);
  color: #245B27;
  text-align: center;
  font-weight: 900;
}
@media (max-width: 1320px) {
  .production-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .production-hero { align-items: stretch; flex-direction: column; }
  .production-board { grid-template-columns: 1fr; }
}

.terminal-head {
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
}
.terminal-search {
  min-width: min(460px, 100%);
  display: grid;
  gap: 5px;
}
.terminal-search label,
.terminal-pay-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.terminal-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 12px;
}
.terminal-table tbody.terminal-order:nth-of-type(even) .terminal-order-main td,
.terminal-table tbody.terminal-order:nth-of-type(even) .terminal-admin-row td {
  background: #FFF8EC;
}
.terminal-order-main td {
  vertical-align: middle;
}
.terminal-money {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.terminal-money span {
  color: var(--muted);
  font-weight: 900;
}
.terminal-money strong {
  font-size: 22px;
}
.terminal-pay-form {
  min-width: 300px;
}
.terminal-pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.terminal-pay-grid label {
  display: grid;
  gap: 4px;
}
.terminal-pay-grid input,
.terminal-pay-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}
.terminal-pay-grid input:disabled {
  background: #EFE6DA;
  color: var(--muted);
}
.terminal-actions {
  min-width: 180px;
}
.terminal-actions .btn {
  width: 100%;
  margin-bottom: 6px;
}
.terminal-admin-row td {
  padding-top: 6px;
  background: rgba(255, 253, 248, .72);
}
.terminal-admin-actions {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  gap: 10px;
  align-items: center;
}
.terminal-status-form,
.terminal-cancel-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.terminal-cancel-form {
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, auto);
}
.terminal-status-form select,
.terminal-cancel-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
}
@media (max-width: 1100px) {
  .terminal-table,
  .terminal-table thead,
  .terminal-table tbody,
  .terminal-table tr,
  .terminal-table th,
  .terminal-table td {
    display: block;
  }
  .terminal-table thead { display: none; }
  .terminal-order-main td { border-bottom: 0; }
  .terminal-pay-form { min-width: 0; }
  .terminal-pay-grid { grid-template-columns: 1fr; }
  .terminal-admin-actions,
  .terminal-status-form,
  .terminal-cancel-form { grid-template-columns: 1fr; }
}
html { scroll-behavior: smooth; }
.terminal-total-cell,
.terminal-vat {
  white-space: nowrap;
}
.order-settings-grid {
  max-width: 980px;
  margin: 0 auto;
}
.settings-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.settings-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.settings-row input,
.settings-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
  padding: 8px 12px;
}
.settings-note {
  margin: 10px 0 0;
}
@media (max-width: 760px) {
  .settings-row { grid-template-columns: 1fr; }
}

.terminal-pay-error {
  min-height: 18px;
  margin-top: 5px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
}
.phone-suggest-field {
  position: relative;
}
.phone-suggest-field input {
  position: relative;
  z-index: 2;
  background: transparent;
}
.phone-ghost {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 34px;
  min-height: 24px;
  color: #B8AEA1;
  pointer-events: none;
  z-index: 1;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
}
.phone-suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 21, 17, .14);
  overflow: hidden;
}
.phone-suggestion {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
}
.phone-suggestion:hover,
.phone-suggestion:focus {
  background: #FFF4E6;
}
.phone-suggestion:last-child {
  border-bottom: 0;
}
.phone-suggestion span {
  color: var(--muted);
  font-size: 13px;
}
.report-table th {
  text-align: center;
  vertical-align: middle;
}
.report-table td {
  text-align: center;
  vertical-align: middle;
}
.report-table td.report-text {
  text-align: left;
}
.report-table .money-accounting {
  margin: 0 auto;
}
.report-chart {
  height: 264px;
  box-sizing: border-box;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(216, 206, 192, .9);
  border-radius: 8px;
  background: #FFFDF8;
}
.report-bar-chart {
  min-height: 0;
  display: flex;
  align-items: end;
  gap: 8px;
  overflow-x: auto;
  justify-content: center;
}
.report-bar-item {
  width: 52px;
  min-width: 52px;
  height: 100%;
  flex: 0 0 52px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  text-align: center;
}
.report-bar-value {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.report-bar-track {
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  border-radius: 8px;
  background: rgba(216, 206, 192, .35);
  overflow: hidden;
}
.report-bar-fill {
  width: 100%;
  min-height: 7px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--gold), var(--brand));
}
.report-bar-label {
  min-height: 30px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.report-donut-chart {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
}
.report-donut-svg {
  width: auto;
  max-width: 260px;
  height: min(100%, 238px);
  overflow: visible;
}
.report-donut-empty {
  fill: none;
  stroke: rgba(216, 206, 192, .75);
  stroke-width: 30;
}
.report-donut-slice {
  fill: none;
  stroke-width: 30;
  stroke-linecap: butt;
}

.report-donut-guide {
  stroke: var(--muted);
  stroke-width: 1.2;
}
.report-donut-percent {
  font-size: 9px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}
.report-donut-percent.inside {
  fill: #FFFDF8;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .28);
  stroke-width: 2px;
}
.report-donut-percent.outside {
  fill: var(--ink);
}
.report-donut-total {
  text-anchor: middle;
  dominant-baseline: middle;
  font-weight: 900;
}
.report-donut-total.amount {
  fill: var(--ink);
  font-size: 10px;
}
.report-donut-legend {
  position: absolute;
  right: calc(50% + clamp(104px, 22%, 142px));
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 7px;
  width: clamp(108px, 20%, 150px);
}
.report-donut-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.report-donut-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.report-donut-legend span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 680px) {
  .report-chart {
    height: auto;
    min-height: 264px;
  }
  .report-donut-chart {
    padding-top: 42px;
  }
  .report-donut-svg {
    width: min(230px, 82%);
    height: auto;
  }
  .report-donut-legend {
    position: static;
    transform: none;
    width: min(260px, 100%);
    justify-self: center;
    margin-top: 8px;
  }
}
.money-accounting {
  display: inline-grid;
  grid-template-columns: auto 9ch;
  gap: .3rem;
  align-items: baseline;
  width: auto;
  margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
.money-accounting span:first-child {
  justify-self: start;
}
.money-accounting span:last-child {
  justify-self: end;
  text-align: right;
}
.report-chart-empty {
  align-self: center;
  margin: auto;
}
.card:has(.report-chart),
.report-pair-card {
  display: flex;
  flex-direction: column;
}
.report-pair-card .table {
  flex: 1 1 auto;
}
.card:has(.report-chart) .table {
  margin-bottom: 12px;
}
