/*
 * KOrder styles · public/css/02e-shared-panels.css
 * Shared panels and controls: workspace, segmented, fields/selects, staff menu grid, cart panel.
 *
 * public/css/*.css used to be one public/styles.css. The files are cut from it in order
 * and index.html loads them in that same order, which is the CSS cascade order: do not
 * reorder the <link> tags, and add a rule to the file that owns its screen.
 * Map: public/css/README.md
 */

.workspace,
.cart-panel,
.form-panel,
.queue-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.workspace {
  min-height: calc(100vh - 118px);
  padding: 16px;
}

.mode-row,
.category-row,
.toolbar,
.queue-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-row {
  justify-content: space-between;
  margin-bottom: 14px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ecefea;
}

.segment {
  min-width: 108px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.segment.active {
  color: #fff;
  background: var(--graphite);
  box-shadow: 0 6px 14px rgba(32, 36, 42, 0.18);
}

.segmented a {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
  text-decoration: none;
}

.segmented a.active {
  color: #fff;
  background: var(--graphite);
  box-shadow: 0 6px 14px rgba(32, 36, 42, 0.18);
}

.segmented.small {
  align-self: center;
}

.counter-service-tabs {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.counter-service-tabs .segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.counter-service-tabs .segment em {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.counter-service-tabs .segment:not(.active) em {
  background: rgba(31, 36, 42, 0.08);
}

.table-controls {
  display: grid;
  grid-template-columns: 120px 116px minmax(180px, 1fr);
  gap: 8px;
}

.field,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 12px;
  outline: none;
}

.select {
  height: 46px;
  min-width: 0;
  padding-right: 34px;
  font-size: 14px;
  line-height: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select option {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
}

.textarea {
  min-height: 74px;
  padding: 10px 12px;
  resize: vertical;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 117, 0.12);
}

.category-row {
  margin: 12px 0 16px;
}

.chip {
  min-height: 37px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 850;
}

.chip.active {
  border-color: var(--coral);
  color: #fff;
  background: var(--coral);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.menu-item {
  display: grid;
  grid-template-rows: 104px auto 1fr;
  min-height: 246px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  gap: 10px;
}

.menu-item:hover {
  transform: translateY(-2px);
  border-color: #bfb7aa;
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.menu-photo {
  display: grid;
  width: 100%;
  height: 104px;
  overflow: hidden;
  place-items: center;
  border-radius: 7px;
  background: #efe8dc;
}

.menu-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-photo-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.menu-photo-empty,
.menu-photo.image-missing {
  border: 1px solid rgba(122, 111, 97, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(239, 232, 220, 0.92)),
    #efe8dc;
}

.tablet-menu-stage .menu-photo-empty span,
.tablet-menu-stage .menu-photo.image-missing .image-fallback-text {
  max-width: 90%;
  color: #5b5248;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

.item-name {
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.badge {
  flex: none;
  max-width: 72px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.badge.empty {
  opacity: 0;
}

.item-meta {
  align-self: end;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-size: 20px;
  font-weight: 900;
}

.route {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cart-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.queue-head h2,
.form-panel h2 {
  margin: 0;
  font-size: 20px;
}
