:root {
  --bg: #0d0f1c;
  --card: rgba(18, 22, 42, 0.82);
  --card-2: rgba(255, 255, 255, 0.08);
  --text: #f7f8ff;
  --muted: #b8bde0;
  --primary: #ff2f75;
  --secondary: #30d2ff;
  --success: #31d37c;
  --warning: #ffd166;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #57bdd6 0%, #f3fbfd 200px, #ffffff 100%);
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 47, 117, 0.25), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(48, 210, 255, 0.2), transparent 35%);
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 8;
}

.brand { display: flex; gap: 12px; align-items: center; }
.brand h1 { margin: 0; font-size: 1.2rem; }
.brand p { margin: 2px 0 0; font-size: 0.85rem; color: #4b5a66; }
.brand-logo { width: 58px; height: 58px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,0.24); }

main { padding: 18px 24px 110px; max-width: 1300px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.section-title h2 { margin: 6px 0; }
.section-title p { color: var(--muted); margin: 0 0 18px; }

#clientView {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  min-width: 0;
}

.client-panel {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px;
  min-width: 0;
}

.qr-table-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(36, 132, 115, 0.14);
  border: 1px solid rgba(36, 132, 115, 0.38);
  color: #14523f;
  font-weight: 700;
  font-size: 0.88rem;
}

.client-statusbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.status-chip {
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 10px;
}

.status-closed { background: #f73939; }
.status-open { background: #2cab47; }
.status-pickup { background: #73a117; }
.status-select {
  margin-left: auto;
  max-width: 180px;
  color: #233138;
  background: #85aa27;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
}

.search-wrap { margin-bottom: 10px; }
#searchInput {
  width: 100%;
  background: #fff;
  color: #1b2a35;
  border: 1px solid #b8c5cc;
  border-radius: 6px;
  padding: 10px 12px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.category-tab {
  border: 1px solid #e8ecef;
  background: #fff;
  color: #1f2b30;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.category-tab.active {
  background: #73a117;
  color: #fff;
  border-color: #73a117;
}

.menu-list { margin-top: 8px; }
.menu-items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.menu-section h3 {
  color: #1b1b1b;
  margin: 8px 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.menu-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border-top: 4px solid #a8c7ce;
  padding: 8px 0;
}

.menu-row h4 {
  margin: 0 0 6px;
  color: #0f1113;
  font-size: clamp(0.88rem, 1.6vw, 1rem);
  overflow-wrap: anywhere;
}

.menu-row p {
  margin: 0 0 10px;
  color: #1a2a33;
  font-size: clamp(0.74rem, 1.45vw, 0.85rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.menu-row-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-row-foot strong {
  color: #7d8f59;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.add-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.3rem;
}

.menu-row-image {
  background: #f3f3f3;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 0;
  max-height: 120px;
  display: grid;
  place-items: center;
}

.menu-row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.menu-row-image span {
  color: #7f8c93;
  font-weight: 700;
}

.menu-empty {
  background: #fff;
  border: 1px solid #d4dde1;
  color: #1a2a35;
  border-radius: 10px;
  padding: 16px;
}

.ticket {
  position: sticky;
  top: 90px;
  height: max-content;
  background: #f7fbfd;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 16px;
  padding: 14px;
  min-width: 0;
}
.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.client-ticket h3,
.client-ticket span,
.client-ticket strong { color: #15232b; }
.order-items { max-height: 310px; overflow: auto; margin-bottom: 10px; }
.order-item { display: flex; justify-content: space-between; gap: 6px; padding: 8px 0; border-bottom: 1px dashed rgba(0,0,0,0.15); font-size: 0.9rem; }
.order-item span { overflow-wrap: anywhere; }
.ticket-row { display:flex; justify-content: space-between; padding: 6px 0; }
.ticket-row.total { font-size: 1.05rem; border-top: 1px solid rgba(0,0,0,0.2); margin-top: 6px; padding-top: 10px; }

.admin-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.admin-panel { max-width: 900px; }
.admin-dashboard {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 12px;
  align-items: stretch;
  min-height: calc(100vh - 108px);
}
.admin-sidebar {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}
.admin-content-panels {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.admin-section-orders.admin-content-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.admin-orders-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.admin-orders-card > h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.admin-orders-card > p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  opacity: 0.88;
}
.admin-orders-card > .actions-row {
  flex-shrink: 0;
}
.admin-sidebar #logoutBtn {
  margin-top: 6px;
  padding: 8px 6px;
  font-size: 0.76rem;
  font-weight: 600;
}
.admin-nav-btn {
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  padding: 8px 6px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.25;
}
.admin-nav-btn.active {
  background: linear-gradient(120deg, var(--primary), #ff6584);
  border-color: transparent;
}
.admin-content-panel { display: none; }
.admin-content-panel.active { display: block; }
.orders-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  flex: 1;
  min-height: 0;
}
.order-column {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.order-column h4 {
  margin: 4px 0 8px;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.orders-column-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.order-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
}
.order-card.order-card--compact {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  height: 228px;
  min-height: 228px;
  max-height: 228px;
  box-sizing: border-box;
}
.order-card.order-card--dinein-session {
  height: auto;
  min-height: 228px;
  max-height: none;
  position: relative;
}
.order-card-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.order-card-new-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #ffd166;
  margin: 2px 0 4px;
  overflow-wrap: anywhere;
}
.order-column-notify {
  position: relative;
  display: inline-block;
}
.order-column-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.table-orders-modal-card {
  width: min(560px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.table-orders-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.table-orders-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.table-orders-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  margin-top: 12px;
  padding-right: 4px;
}
.table-orders-modal-footer {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
}
.table-folio-block {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}
.table-folio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.82rem;
}
.table-folio-title {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.table-folio-head strong {
  font-weight: 700;
}
.table-folio-actions {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}
.table-folio-toggle {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.75rem;
}
.table-folio-print,
.table-folio-delete {
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.78rem;
}
.table-folio-print {
  background: rgba(48, 210, 255, 0.2);
  color: #7fe9ff;
}
.table-folio-delete {
  background: rgba(229, 57, 53, 0.22);
  color: #ffb4b2;
}
.table-folio-body {
  padding: 0 10px 10px;
  font-size: 0.78rem;
}
.table-folio-body.hidden-folio {
  display: none;
}
.table-folio-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.table-folio-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}
.table-orders-totals-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
}
.table-orders-totals-row.total-final {
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: 8px;
}
.order-card-row--head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.order-card-primary {
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.order-card-row--labeled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.order-card-label {
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}
.order-card-value {
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-card-value--total {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}
.order-card-status-chip {
  font-size: 0.75rem;
  padding: 4px 8px;
}
.order-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.order-card-actions .btn {
  flex: 1 1 calc(50% - 3px);
  min-width: 72px;
  padding: 7px 8px;
  font-size: 0.72rem;
}
.order-wa-placeholder {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.order-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.order-wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(37, 211, 102, 0.18);
  color: #25d366;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.order-wa-link:hover {
  background: rgba(37, 211, 102, 0.35);
  color: #1ebe57;
}
.muted-empty {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}
.new-order-alert {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 75, 75, 0.18);
  border: 1px solid rgba(255, 75, 75, 0.45);
  color: #ffd7d7;
  font-weight: 700;
  font-size: 0.82rem;
}
.new-order-alert.pulse {
  animation: orderAlertPulse 0.6s ease-in-out 3;
}

@keyframes orderAlertPulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
input, select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  border-radius: 10px;
  padding: 10px;
}
option { color: #000; }

.actions-row { display:flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display:flex; gap: 8px; }
.inline-form input { flex: 1; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary { background: linear-gradient(120deg, var(--primary), #ff6584); color: #fff; }
.btn-secondary { background: linear-gradient(120deg, #6f75ff, #30d2ff); color: #fff; }
.btn-success { background: linear-gradient(120deg, #24bf66, #4be09d); color: #04140c; }
.btn-ghost { background: rgba(255,255,255,0.1); color: #fff; }
.btn-full { width: 100%; margin-top: 8px; }

.file-label { display:inline-flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,0.08); cursor: pointer; }
.file-label input { display:none; }

.chips { display:flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { background: var(--card-2); border-radius: 999px; padding: 7px 12px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.1); }
.admin-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.admin-setting-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.admin-setting-item--inactive {
  opacity: 0.72;
  border-style: dashed;
}
.admin-setting-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.admin-setting-item-meta {
  font-size: 0.9rem;
  opacity: 0.9;
}
.admin-setting-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.history-search-label {
  display: block;
  margin-top: 12px;
}
.history-search-label input {
  margin-top: 6px;
  width: min(420px, 100%);
}
.table-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.table-remove-btn {
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  line-height: 1;
}

.table-qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.table-qr-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.table-qr-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-qr-card--inactive {
  opacity: 0.75;
  border-style: dashed;
}
.table-qr-inactive-note {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted, rgba(255, 255, 255, 0.65));
}
.table-qr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.table-qr-head strong {
  font-size: 0.92rem;
}

.table-qr-img-link {
  display: block;
  align-self: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 0;
}

.table-qr-img {
  display: block;
  width: 200px;
  height: 200px;
  object-fit: contain;
  background: #fff;
}

.table-qr-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.workdays {
  margin: 10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.workdays label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.manual-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-menu-modal-card {
  width: min(980px, 96vw);
  max-height: 86vh;
  overflow: auto;
}
.admin-menu-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.admin-menu-modal-head-text {
  min-width: 0;
}
.admin-menu-modal-head-text h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.admin-menu-modal-sub {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.88;
}
.admin-menu-modal-close {
  flex-shrink: 0;
  font-size: 1.65rem;
  line-height: 1;
  padding: 4px 12px;
  border-radius: 10px;
}
.menu-manager-quick-actions {
  margin-bottom: 12px;
}
.menu-manager-add-panel {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.admin-menu-item select.edit-categoria {
  width: 100%;
}
.admin-menu-manager-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.admin-menu-filters {
  margin-top: 8px;
}
.admin-menu-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px;
}
.admin-menu-item.off {
  opacity: 0.7;
  border-style: dashed;
}
.admin-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: grid;
  place-items: center;
  z-index: 15;
}
.modal-card {
  width: min(680px, 95vw);
  background: #11162a;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.15);
}

.checkout-qr-lock select:disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

.assistant {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  z-index: 20;
}
.assistant-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(from 130deg, var(--primary), var(--secondary), var(--primary));
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 0 rgba(255, 47, 117, 0.6);
  animation: pulse 1.8s infinite;
}
.assistant-avatar span { display: block; width: 8px; height: 8px; background: #fff; border-radius: 50%; margin: 2px; }
.assistant-chat {
  max-width: min(320px, calc(100vw - 100px));
  background: rgba(14, 18, 35, 0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 10px 12px;
}
.assistant-chat h4 { margin: 0; font-size: 0.9rem; color: #ffe4ee; }
.assistant-chat p { margin: 6px 0 0; font-size: 0.88rem; color: #f7f8ff; }
.assistant-order {
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 8px;
  font-size: 0.8rem;
  color: #f3f8ff;
}
.assistant-order .line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0;
  flex-wrap: wrap;
}
.assistant-order .line.total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  flex-wrap: wrap;
}

.assistant-confirm-btn {
  margin-left: auto;
  padding: 6px 10px;
  font-size: 0.75rem;
}
.assistant-confirm-btn.attention {
  animation: confirmPulse 0.7s ease-in-out 3;
}

.assistant.assistant-collapsed .assistant-chat {
  display: none;
}

.assistant.assistant-collapsed .assistant-avatar {
  width: 48px;
  height: 48px;
}

@keyframes confirmPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 47, 117, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(255, 47, 117, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 47, 117, 0); }
}

.hidden { display: none !important; }
.mobile-only { display: none; }
.mobile-cart-btn {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 26;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 960px) {
  #clientView { grid-template-columns: 1fr; gap: 12px; }
  .ticket { position: static; }
  .menu-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-row { grid-template-columns: 1fr; }
  .menu-row-image { max-height: 220px; }
  .menu-section h3 { font-size: 1.4rem; }
  .menu-row h4 { font-size: 1.1rem; }
  .menu-row p { font-size: 1rem; }
  .menu-row-foot strong { font-size: 1.2rem; }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 14px;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .brand h1 { font-size: 1rem; }
  .brand p { font-size: 0.78rem; }

  main {
    padding: 10px 10px 96px;
  }

  .client-panel,
  .ticket,
  .admin-card,
  .modal-card {
    border-radius: 10px;
    padding: 10px;
  }

  .status-chip {
    font-size: 0.78rem;
    padding: 7px 8px;
  }

  .status-select {
    max-width: 120px;
    font-size: 0.78rem;
    padding: 7px 8px;
  }

  .category-tab {
    font-size: 0.8rem;
    padding: 7px 10px;
  }

  .menu-row {
    gap: 8px;
    padding: 8px 0;
  }

  .menu-row-foot {
    justify-content: space-between;
  }

  .add-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .btn {
    min-height: 42px;
  }

  .inline-form {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
  .orders-board {
    grid-template-columns: 1fr;
  }

  .assistant {
    right: 10px;
    left: 10px;
    bottom: 62px;
    gap: 8px;
  }

  .assistant-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
  }

  .assistant-chat {
    max-width: none;
    width: calc(100vw - 82px);
  }

  .modal {
    align-items: end;
    padding: 8px;
  }

  .modal-card {
    width: 100%;
    max-height: 86vh;
    overflow: auto;
  }

  .mobile-only { display: inline-flex; }
  .client-ticket {
    display: none;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    max-height: 72vh;
    overflow: auto;
    z-index: 32;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
    width: calc(100vw - 20px);
  }
  .client-ticket.open-mobile {
    display: block;
  }
}

@media (max-width: 430px) {
  .client-statusbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .status-select {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  #searchInput {
    font-size: 0.95rem;
  }

  .menu-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .menu-section h3 { font-size: 1.06rem; }
  .menu-row h4 { font-size: 0.92rem; }
  .menu-row p { font-size: 0.78rem; }
  .menu-row-foot strong { font-size: 0.9rem; }
  .add-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .menu-row-image {
    max-height: 92px;
  }

  .ticket-row,
  .order-item {
    font-size: 0.85rem;
  }

  .assistant-chat {
    width: calc(100vw - 76px);
    padding: 8px 9px;
  }

  .assistant-chat h4 {
    font-size: 0.82rem;
  }

  .assistant-chat p,
  .assistant-order {
    font-size: 0.75rem;
  }

  .ticket-row {
    font-size: 0.8rem;
  }

  .assistant {
    left: 6px;
    right: 6px;
  }

  .mobile-cart-btn {
    left: 6px;
    right: 6px;
    bottom: 6px;
  }
}

@media (max-width: 360px) {
  .menu-items-grid {
    grid-template-columns: 1fr;
  }

  .status-chip {
    font-size: 0.72rem;
    padding: 6px 7px;
  }
}
