:root {
  --service-top: 60px;
  --service-bottom: 76px;
}
body {
  padding-top: var(--service-top);
  padding-bottom: calc(var(--service-bottom) + env(safe-area-inset-bottom));
}
.service-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--service-top);
  background: var(--panel, #fff);
  border-bottom: 1px solid #8884;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
}
.service-header strong {
  font-size: 26px;
  letter-spacing: 3px;
}
.service-header button {
  border: 0;
  background: transparent;
}
.service-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: calc(var(--service-bottom) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel, #fff);
  border-top: 1px solid #8884;
}
.service-footer > button {
  position: relative;
  font-size: 28px;
  background: transparent;
  border: 0;
  min-width: 60px;
}
.service-footer .launch-circle {
  border-radius: 50%;
  height: 62px;
  width: 62px;
  background: #16824f;
  color: white;
  font-size: 40px;
  margin-top: -18px;
  box-shadow: 0 3px 15px #0003;
}
.service-footer b,
.notification-dot {
  position: absolute;
  right: 5px;
  top: 0;
  background: #dc403e;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  padding: 3px 6px;
}
.notification-dot {
  width: 9px;
  height: 9px;
  padding: 0;
}
.layout {
  display: block;
}
.sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: var(--service-top);
  bottom: calc(var(--service-bottom) + env(safe-area-inset-bottom));
  width: min(340px, 85vw);
  overflow: auto;
  z-index: 80;
  background: var(--panel, #fff);
}
.sidebar.drawer-open {
  display: block;
}
.drawer-shade {
  position: fixed;
  inset: 60px 0 76px;
  background: #0008;
  border: 0;
  z-index: 70;
  width: 100%;
  border-radius: 0;
}
.drawer-shade[hidden] {
  display: none;
}
.drawer-close {
  margin: 14px;
}
.main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px;
}
.service-table-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.service-table-title h1 {
  font-size: 24px;
}
.service-table-title span {
  font-size: 12px;
}
.service-table-title i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 4px 0 8px;
}
.service-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.service-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  gap: 7px;
  border-radius: 18px;
  color: #13251b;
  border: 2px solid transparent;
}
.service-table strong {
  font-size: 32px;
}
.service-table small {
  font-size: 11px;
}
.free {
  background: #ccebd6;
}
.occupied {
  background: #ffe49b;
}
.closed {
  background: #ffc3c0;
}
.resume-pill {
  position: fixed;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 49;
}
.order-picker .modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}
.picker-toolbar {
  padding: 14px 20px;
  background: var(--panel, #fff);
  flex-shrink: 0;
  border-bottom: 1px solid #8883;
}
.picker-toolbar input {
  font-size: 16px;
}
.picker-scroll {
  overflow-y: auto;
  min-height: 0;
  padding: 16px 20px;
  flex: 1;
}
.picker-footer {
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  background: var(--panel, #fff);
  border-top: 1px solid #8883;
  flex-shrink: 0;
}
.order-picker .modal-head {
  padding: 14px 20px 0;
  margin: 0;
}
.order-picker .product-options {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  gap: 10px;
  white-space: normal;
}
.category-tile span {
  font-size: 25px;
  color: #16824f;
}
.picker-back {
  background: #e0eee6;
  color: #17442e;
}
.product-option {
  min-height: 160px;
}
.alert-list {
  max-height: 65dvh;
  overflow: auto;
}
@media (max-width: 760px) {
  .main {
    padding: 12px;
  }
  .service-table-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .service-table {
    min-height: 106px;
    border-radius: 14px;
    padding: 8px 3px;
  }
  .service-table strong {
    font-size: 26px;
  }
  .service-table-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .service-table-title h1 {
    margin: 0 0 6px;
  }
  .service-tables .notice {
    display: none;
  }
  .order-picker {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .order-picker .modal-body {
    height: 100dvh;
    max-height: 100dvh;
  }
  .order-picker .product-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .picker-toolbar,
  .picker-scroll,
  .picker-footer {
    padding: 12px;
  }
  .picker-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .picker-footer .primary {
    flex: 1;
  }
  .category-tile {
    min-height: 110px;
  }
  .product-option img {
    height: 90px;
  }
  .order-picker .modal-head h2 {
    font-size: 20px;
  }
  .service-header {
    padding: 8px 12px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .table-grid.launch-mesas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.dispatch-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 20px;
}
.dispatch-map {
  width: 100%;
  height: 520px;
  border: 0;
  border-radius: 12px;
}
.route-pick {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #8883;
  padding: 12px 0;
}
.route-pick input {
  width: auto;
}
.route-pick small {
  display: block;
  font-size: 12px;
  margin-top: 6px;
}
.route-report-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #8883;
}
.route-report-row input {
  width: auto;
}
.route-report-row label {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}
.ticket-qr svg {
  width: 34mm;
  height: 34mm;
  display: block;
  margin: auto;
}
.receipt pre {
  white-space: pre-wrap;
  font: 700 12px monospace;
}
.delivery-code {
  border: 2px solid #b98d47;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}
.delivery-code strong {
  font-size: 32px;
  letter-spacing: 8px;
  display: block;
}
.courier-video {
  width: 100%;
  max-height: 65dvh;
  background: #111;
}
.courier-route-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid #8884;
  border-radius: 16px;
  margin: 12px 0;
}
.courier-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel, #151515);
  padding: 12px;
  display: flex;
  justify-content: space-around;
  z-index: 50;
}
.courier-footer button {
  min-width: 60px;
}
.courier-body {
  padding-bottom: 90px;
}
.courier-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--panel, #151515);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
}
.courier-body .menu-intro {
  display: block;
}
.courier-body button,
.courier-body input,
.courier-body textarea {
  font-size: 16px;
}
@media (max-width: 760px) {
  .dispatch-layout {
    grid-template-columns: 1fr;
  }
  .dispatch-map {
    height: 420px;
  }
  .route-report-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media print {
  body {
    padding: 0;
  }
  .service-header,
  .service-footer {
    display: none !important;
  }
  .ticket-qr svg {
    width: 34mm;
    height: 34mm;
  }
  .receipt pre {
    font-weight: 700;
  }
}
.picker-back:hover,
.picker-back:focus {
  background: #c5e4d2;
  color: #123d27;
}
.service-footer svg {
  display: block;
  margin: auto;
}
.launch-circle {
  font-family: Arial, sans-serif;
}
.service-table:focus {
  outline: 3px solid #16824f;
  outline-offset: 2px;
}
.sidebar {
  position: fixed !important;
  max-width: 85vw;
  overflow-y: auto !important;
}
.sidebar .workspace-nav {
  grid-template-columns: 1fr !important;
}
.sidebar .workspace-version {
  display: block;
}
.sidebar button {
  width: 100%;
  white-space: normal;
}
.sidebar .nav-group-toggle {
  display: flex;
}
.sidebar .nav-group-items {
  display: grid;
}
.drawer-shade {
  height: auto;
}
.service-footer > button {
  width: auto;
}
.item-photo img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 12px;
  background: #8881;
}
.item-photo {
  min-width: 0;
}

.sidebar .nav-group-toggle, .sidebar .nav-group-items button, .sidebar .workspace-version, .sidebar .drawer-close { color: var(--text) !important; }
:root[data-theme='light'] .sidebar .nav-group-items button.active { color: #ffffff !important; background: #126951 !important; }
