/* Shared controls and forms for the counter. */
.action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; line-height: 1.4; cursor: pointer; text-align: center; }
.action-btn--primary { background: var(--navy); color: #fff; }
.action-btn--gold { background: var(--gold); color: var(--navy); }
.action-btn--outline { background: transparent; border-color: var(--line); color: var(--text); }
.action-btn:hover { filter: brightness(.95); }
.preset-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: stretch; margin-top: 20px; }
.preset-controls select { width: 100%; min-width: 0; min-height: 48px; text-overflow: ellipsis; }
.preset-controls .action-btn { max-width: 240px; }
.add-product-form { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 16px; padding: 24px; }
.add-product-form > div { grid-column: span 2; min-width: 0; }
.add-product-form > div:first-child { grid-column: span 4; }
.add-product-form label, #form-edit-product label { display: block; margin-bottom: 8px; line-height: 1.4; }
.add-product-form input, .add-product-form select { min-height: 48px; width: 100%; }
.currency-field { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 10px; margin-top: 4px; }
.currency-field > span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.currency-field input { flex: 1; min-width: 0; border: none !important; margin-top: 0 !important; padding: 10px 0 !important; background: transparent; }
.currency-field:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.emoji-picker-container { gap: 8px; padding: 12px; }
.emoji-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: var(--surface-soft); border-color: var(--line-soft); }
.modal-card { max-height: calc(100dvh - 40px); overflow-y: auto; }
/* Room for each action and a consistent status column. */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 14px 12px; background: var(--surface-soft); }
.data-table td { vertical-align: middle; }
.data-table td:nth-child(4), .data-table td:nth-child(5) { white-space: nowrap; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 190px; }
.order-actions .btn-action-sm { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin: 0; padding: 10px 14px; border-radius: 10px; white-space: nowrap; line-height: 1.3; }
.order-actions .btn-action-sm--cancel { background: #fff1f2; color: #b42335; border: 1px solid #fecdd3; }
.status-pill { padding: 7px 10px; font-weight: 700; }
.status-pill--CANCELLED { background: #fff1f2; color: #b42335; }
/* Product names occupy their own line, with controls below. */
.menu-manager-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; gap: 24px; }
.menu-cat-card { min-width: 0; padding: 20px; }
.menu-item-row { gap: 14px; padding: 20px 0; }
.menu-item-row:last-child { border-bottom: none; padding-bottom: 0; }
.menu-item-top { display: grid; gap: 14px; }
.menu-item-info { align-items: flex-start; gap: 12px; font-size: 1rem; line-height: 1.45; min-width: 0; }
.menu-item-info > span { flex: 0 0 32px; text-align: center; }
.menu-item-info > div { min-width: 0; overflow-wrap: anywhere; }
.menu-item-info small { display: block; margin-top: 4px; }
.menu-item-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-item-controls .btn-chip-sm { min-height: 40px; padding: 10px 12px; font-size: .8rem; font-weight: 700; line-height: 1.3; }
.product-remove { margin-left: auto; min-width: 40px; min-height: 40px; border-radius: 10px; background: #fff1f2 !important; }
.menu-item-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.menu-item-bottom span { display: flex; flex-direction: column; gap: 6px; line-height: 1.4; color: #52627d; }
.menu-item-bottom strong { font-size: 1rem; color: var(--navy); }
@media (max-width: 1100px) {
  .preset-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-controls select { grid-column: 1 / -1; }
  .preset-controls .action-btn { max-width: none; }
}
@media (max-width: 640px) {
  .preset-controls, .add-product-form { grid-template-columns: minmax(0, 1fr); }
  .preset-controls > *, .add-product-form > div, .add-product-form > div:first-child { grid-column: 1 / -1; }
  .add-product-form { padding: 16px; }
  .add-product-form button[type="submit"] { width: 100%; }
  .menu-cat-card { padding: 16px; }
  .menu-item-bottom { gap: 8px; padding: 10px; font-size: .75rem; }
  .menu-item-bottom strong { font-size: .85rem; }
  .admin-header { flex-wrap: wrap; gap: 16px; }
}

/* Quiet actions and more readable order details. */
.order-actions { gap: 8px; min-width: 170px; }
.order-actions .btn-action-sm { min-height: 40px; padding: 9px 12px; border: 1px solid #dce3ef; background: #f8fafc; color: #334155; font-weight: 600; }
.order-actions .btn-action-sm:hover { background: #edf2f7; border-color: #b8c5d8; }
.order-actions .btn-action-sm--cancel { background: transparent; border-color: transparent; color: #a64451; }
.order-actions .btn-action-sm--cancel:hover { background: #fff1f2; border-color: #fecdd3; }
.order-id { display: block; margin-bottom: 10px; }
.order-dish { font-size: 1rem; line-height: 1.5; padding: 6px 0; }
.order-dish + .order-dish { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 12px; }
.order-dish__details { display: block; margin-top: 6px; font-size: .9rem; line-height: 1.6; color: #52627d; }
.menu-item-row { position: relative; padding-top: 60px; }
.menu-item-row > .product-remove { position: absolute; top: 12px; right: 0; left: auto; margin: 0; width: 32px; min-width: 32px; height: 32px; min-height: 32px; border-radius: 8px; border: 1px solid #fecdd3 !important; background: #fff1f2 !important; }
.menu-item-row > .product-remove:hover { background: #fff1f2 !important; }
.menu-item-row > .menu-item-controls { padding-top: 2px; }

/* One price field and a compact editor without an inner scrollbar. */
.currency-field input:focus-visible { outline: none; box-shadow: none; }
.currency-field:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.modal-backdrop { overflow-y: auto; align-items: flex-start; }
.modal-card { width: min(640px, 100%); max-height: none; overflow: visible; margin: auto; }
#form-edit-product { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
#form-edit-product > div { grid-column: 1 / -1; min-width: 0; margin-bottom: 0 !important; }
#form-edit-product > div:nth-of-type(2), #form-edit-product > div:nth-of-type(3) { grid-column: span 1; }
#form-edit-product label { margin-bottom: 4px; font-size: .82rem; color: #52627d; font-weight: 600; }
#form-edit-product .emoji-picker-container { margin-top: 8px; gap: 6px; padding: 10px; }
.order-actions .btn-action-sm--cancel { width: 40px; height: 40px; padding: 0; flex: 0 0 40px; color: #dc2626; border-color: transparent; background: transparent; }
.order-actions .btn-action-sm--cancel svg { display: block; }
@media (max-width: 480px) {
  #form-edit-product { grid-template-columns: minmax(0, 1fr); }
  #form-edit-product > div:nth-of-type(2), #form-edit-product > div:nth-of-type(3) { grid-column: 1 / -1; }
  .modal-backdrop { padding: 12px; }
  .modal-card { padding: 20px; }
}

/* Fixed action tracks align the trash icon across every order row. */
.order-actions { display: grid; grid-template-columns: minmax(120px, 1fr) 40px; align-items: center; gap: 8px; width: 100%; min-width: 168px; }
.order-actions .btn-action-sm:not(.btn-action-sm--cancel) { grid-column: 1; width: 100%; }
.order-actions .btn-action-sm--cancel { grid-column: 2; grid-row: 1; justify-self: end; }

/* Each ingredient has a visible boundary and breathing room. */
.menu-item-row { margin: 16px 0 0; padding: 58px 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.menu-item-row:last-child { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.menu-item-row > .product-remove { right: 12px; }
@media (max-width: 640px) {
  .menu-item-row { padding-right: 12px; padding-left: 12px; }
}
.order-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order-filters input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.order-filters label { font-size: .85rem; font-weight: 600; color: #52627d; }
.order-time { display: block; color: #52627d; margin: -4px 0 10px; }
#admin-tab-pedidos > div > div:first-child { flex-wrap: wrap; gap: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Categories flow one after another, regardless of product counts. */
.menu-manager-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.menu-cat-card > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: stretch; }
.menu-cat-card .menu-item-row { margin: 0; }
.menu-item-row > .menu-item-controls { margin-top: auto; }

.order-filters > #order-date-label { font-size: .85rem; font-weight: 600; color: #52627d; }

/* Dark table heading separates the labels from order rows. */
#orders-admin-tbody { border-top: 0; }
#admin-tab-pedidos .data-table thead th { background: #1e293b; color: #fff; border-bottom: 0; font-weight: 700; }
#admin-tab-pedidos .data-table thead th:first-child { border-radius: 10px 0 0 10px; }
#admin-tab-pedidos .data-table thead th:last-child { border-radius: 0 10px 10px 0; }
