﻿:root {
  --bg: #f6f7f2;
  --ink: #1d2720;
  --muted: #657064;
  --line: #dce2d5;
  --panel: #ffffff;
  --accent: #728980;
  --accent-dark: #1f5d43;
  --sun: #d89a2b;
  --blue: #2596be;
  --danger: #b84a3a;
  --brown: #331a00;
  --green: #b8ded0;
  --light-blue: #3554c8;
  --orange:#ea8f38;
  --pink:#deb8c6;
  --light-brown:#cfb0a8;
  font-family: "Noto Sans TC", "sans-serif";
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: white;
}

button,
input,
select {
  font: inherit;
  font-weight:500;

}
input,
select {
    width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;

}

input:focus,
select:focus {
  outline: 3px solid rgba(47, 125, 91, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  color: #fff;
  background: var(--light-brown);
  cursor: pointer;
  font-weight: 500;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(18px, 5vw, 56px);
  background: transparent;
  border-bottom: 1px solid var(--line);
  position: relative; /* 改成 relative 就不會跟著滑動了 */
  top: auto; /* 也可以直接把這行跟上面那行刪掉 */
  z-index: 5;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

h3 {
  margin-bottom: 14px;
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 36px auto 72px;
  flex: 1;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  margin-bottom: 18px;
}
.muted {
  display: inline-flex;
}
.admin-button {
  background: var(--light-brown);
}

.ghost-button {
  margin-bottom: 20px;
  color: var(--muted);
  background: transparent;
  border: 1px solid  var(--muted);
  margin-left: auto;
  display: block;
}

.ghost-button:hover {
  color: white;
  background: var(--light-brown);
  border: 1px solid  transparent;
}

.order-list,
.manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));

  gap: 16px;
}

.order-card,
.manage-card,
.panel,
.form-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(36, 57, 42, 0.08);
}

.order-card,
.manage-card {
  padding: 20px;
}

.order-card h3,
.manage-card h3 {
  margin-bottom: 6px;
}

.store-item-line {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.deadline-line {
  margin-bottom: 12px;
  color: rgba(237, 112, 77);
  font-weight: 800;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: #e8f2eb;
  font-size: 13px;
  font-weight: 700;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: start;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.form-shell {
  padding: 24px;
}

.form-shell label {
  font-weight: 500;
}
.form-shell input{
  font-weight: 300;
}
.form-shell option{
  font-weight: 300;
}
.summary {
  position: sticky;
  top: 112px;
}

.item-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  font-weight: 500;
}

.quick-add {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.quick-add-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 112px 88px;
  gap: 10px;
}

.quick-add-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.quick-add-checkbox input {
  width: auto;
  padding: 0;
}

.customer-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.customer-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.customer-item-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  margin: 2px 0 0;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.addon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.addon-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
}

.addon-option input {
  width: auto;
}

.item-price {
  color: var(--sun);
  font-weight: 700;
  font-size: 100%;
}

.quantity-control {
  display: grid;
  grid-template-columns: 38px 56px 38px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quantity-control button {
  width: 38px;
  height: 30px;
  padding: 0;
  border-radius: 0;
  background: var(--green);
  color: var(--brown);
}

.quantity-control span {
  text-align: center;
  font-weight: 800;
}

.quantity-control input[type="number"] {
  width: 100%;
  height: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  -moz-appearance: textfield;
}

.quantity-control input[type="number"]::-webkit-inner-spin-button,
.quantity-control input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-summary {
  display: grid;
  gap: 10px;
  min-height: 72px;
  color: var(--muted);
}

.submitted-orders {
  display: grid;
  gap: 12px;
}

.draft-box,
.submitted-title {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.total-row.compact {
  margin-top: 12px;
  padding-top: 12px;
  font-size: 20px;
}

.person-order {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.person-order h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.person-order h4 span {
  display: inline-flex;
  gap: 6px;
}

.person-order p {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.readonly-name {
  display: block;
  margin-bottom: 10px;
}
/*查看訂單按鈕*/
.check-order-button {
  background: gray;
  font-size: 16px !important;
  font-weight: 400 !important;
  padding: 4px 10px 4px 10px;
  border-radius: 10px !important;
}
/*已結單顯示格式*/
.order-closed {
  background: rgba(238, 238, 238);
  color: rgba(92, 92, 92);
  font-size: 15px;
  font-weight: 500;
  padding: 4px 10px 4px 10px;
  border-radius: 1999px;
}
/*開放中顯示格式*/
.order-open {
  background: #e8f2eb;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 500;
  padding: 4px 10px 4px 10px;
  border-radius: 999px;
}

.edit-order-button,
.delete-order-button {
  color: white;
  font-size: 16px;
  border-radius: 10px;
  font-weight: 400;
  padding: 4px 10px 4px 10px;
}
/*編輯按鈕*/
.edit-order-button {
  background: var(--blue);
}
.edit-order-button:hover {
  background: var(--blue);
}

/*刪除按鈕*/
.delete-order-button {
  background: rgba(237, 112, 77);
}

.manage-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.delete-order-button:hover,
.remove-button:hover {
  background: rgba(237, 112, 77);
}

.submitted-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.submitted-line p {
  margin-bottom: 0;
}

.readonly-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.line-total {
  color: var(--ink);
  font-weight: 800;
}

.aggregate-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--ink);
}

.cart-line,
.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cart-line {
  color: var(--ink);
}

.total-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-actions button {
  min-height: 104px;
  font-size: 20px;
}

.form-shell {
  max-width: 680px;
  margin: 0 auto;
}

.form-shell.wide {
  max-width: 860px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}


.item-editor {
  margin: 22px 0;
}

.item-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-tag-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf6;
}

.store-category-editor {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf6;
}

.menu-tag-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
/*新增店家分類按鈕*/
.menu-tag-add {
  width: 80%;
  padding: 9px 12px;
  margin: 4px auto 8px auto;
  background: #f4f8f2;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  display: block;
}

.menu-tag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-tag-tab {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.menu-tag-tab.active {
  border-color: var(--accent);
  background: #e8f2eb;
}

.menu-tag-tab.dragging {
  opacity: 0.55;
  outline: 2px solid var(--accent);
}

.menu-tag-select,
.menu-tag-drag,
.menu-tag-action {
  width: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.menu-tag-drag {
  align-self: stretch;
  padding: 8px 9px;
  color: var(--muted);
  cursor: grab;
  border-right: 1px solid var(--line);
  font-size: 15px;
  line-height: 1;
}
.menu-tag-drag:hover {
  color: white;
}

.menu-tag-drag:active {
  cursor: grabbing;
}

.menu-tag-select {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
}
.menu-tag-select:hover {
  color: white;
}
.menu-tag-action {
  min-width: 30px;
  padding: 8px 9px;
  color: var(--muted);
}


.store-cat-tab:hover .menu-tag-action.danger:hover,
.store-cat-tab.active .menu-tag-action.danger:hover {
  color: rgba(237, 112, 77);
}

.menu-tag-empty {
  color: var(--muted);
  font-size: 13px;
}

.menu-tag-current {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf5e9;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.store-category-select-label {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.store-category-select-label select {
  padding: 8px 10px;
  font-size: 14px;
}

/* ???∠? */
.item-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  background: #fbfcf8;
  display: grid;
  gap: 14px;
}

.item-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.item-card-basic {
  display: flex;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.item-name-fields {
  display: grid;
  gap: 8px;
  flex: 1 1 360px;
  min-width: 140px;
}

.item-meta-fields {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.item-card-basic input[data-field="price"] {
  width: 100px;
}

.item-card-basic input[data-field="description"] {
  font-size: 14px;
  padding: 10px 12px;
  background: #fff;
}

.item-card-section {
  display: grid;
  gap: 8px;
}

.item-card-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-section-label {
  font-size: 18px;
  font-weight: 500;
  color: var(--muted);
}

.toggle-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-btn {
  padding: 7px 14px;
  font-size: 15px;
  font-weight: 400;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.toggle-btn:hover {
  border-color: var(--accent);
  background: #e8f2eb;
  color: var(--accent-dark);
}

.toggle-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.category-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-name-input {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  min-width: 100px;
  padding: 6px 10px;
}

.category-type-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
}

.category-type-label input {
  width: auto;
  padding: 0;
}

.category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-category-btn {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  padding: 8px;
  font-size: 14px;
}

.add-category-btn:hover {
  background: #e8f2eb;
  color: var(--accent-dark);
}

.option-tag-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f4ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px 4px 10px;
}

.add-shared-option-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
}

.option-tag-row input {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 14px;
  width: auto;
  min-width: 60px;
}

.option-tag-row input:focus {
  outline: none;
  background: #fff;
  border-radius: 4px;
}

.option-tag-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: rgba(237, 112, 77);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.option-tag-remove:hover {
  background: #963729;
}

.option-add-btn {
  padding: 4px 12px;
  font-size: 13px;
  background: transparent;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
}

.option-add-btn:hover {
  background: #e8f2eb;
  color: var(--accent-dark);
}

.remove-button {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(237, 112, 77);
  flex-shrink: 0;
}

.menu-upload-area {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #fbfcf8;
  transition:
    border-color 0.15s,
    background 0.15s;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-upload-area:hover,
.menu-upload-area.drag-over {
  border-color: var(--accent);
  background: #e8f2eb;
}

.menu-upload-area.has-file {
  border-style: solid;
  border-color: var(--accent);
  background: #f0f9f4;
}

.menu-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.menu-file-info span {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
  word-break: break-all;
}

.menu-file-remove {
  padding: 4px 10px;
  font-size: 13px;
  background: rgba(237, 112, 77);
  color: #fff;
  border-radius: 6px;
  flex-shrink: 0;
}
/*菜單圖片按鈕*/
.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px 0;
  padding: 2px 7px 2px 7px;
  border-radius: 8px;
  border: 1.5px solid var(--brown);
  background: rgba(49, 33, 2, 0.1);
  color: var(--brown);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  width: 60px;
  justify-content: center; /* 關鍵：讓內容水平置中 */
}

.menu-link:hover {
  background: #e69900;
  color: white;
  border: 1px solid transparent;
}

.empty {
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.payment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.payment-row select {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
}

.payment-change-input {
  width: 120px !important;
  padding: 8px 10px;
  font-size: 14px;
}

.payment-status-row {
  margin-top: 8px;
}
/*付款狀態*/
.payment-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 800;
}
/*付款狀態 未付款*/
.payment-badge.unpaid {
  background: #fdecea;
  color: rgba(237, 112, 77);
  font-size: 15px;
  font-weight: 500;
}
/*付款狀態 已付款*/
.payment-badge.paid {
  background: #e8f2eb;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 500;
}
/*付款狀態 已付款待找零*/
.payment-badge.change {
  background: #fef6e4;
  color: #a06c0a;
  font-size: 15px;
  font-weight: 500;
}

/* ?? item-row 靽??詨捆??*/
.item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 100px 120px 150px 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.item-options-expanded {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  animation: fadeIn 0.15s ease;
}
.ai-upload-zone {
  transition: all 0.3s ease;
}

.custom-file-upload span:hover {
  filter: brightness(1.1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.submit-order-button {
  width: 100%;
  margin-top: 14px;
  background: var(--green);
  color: var(--brow);
}

/* ?? item-row 靽??詨捆??*/
.item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 100px 120px 150px 44px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 760px) {
  .topbar {
    align-items: flex-end;
  }

  .order-layout {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .summary {
    position: static;
  }

  .customer-item,
  .submitted-line,
  .item-row,
  .quick-add-grid {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    width: 136px;
  }
}

/* ?? ???璅惜 ?? */
.menu-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.menu-tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.menu-tab:hover {
  border-color: var(--accent);
  background: #e8f2eb;
  color: var(--accent-dark);
}

.menu-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ???∠?嚗??桀?憿????*/
select.menu-tag-select-inline {
  align-self: stretch;
  padding: 0 28px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf5e9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2357875c'/%3E%3C/svg%3E") no-repeat
    right 10px center / 10px 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 90px;
}
select.menu-tag-select-inline:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

/* 編輯店家品項的頁面 */
.store-editor-wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
  align-items: start;
}

.store-editor-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: #f8fbf6;
  min-height: calc(100vh - 160px);
  border-radius: 10px 0 0 10px;
}

.store-sidebar-header {
  padding: 0 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.store-sidebar-header .eyebrow {
  margin-bottom: 2px;
}

.store-sidebar-name {
  font-size: 25px;
  font-weight: 500;
  margin: 0;
  word-break: break-all;
  color: var(--brown);
}

.store-sidebar-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brown);
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.store-sidebar-tab:hover {
  background: var(--accent);
  color: #fff;
}

.store-sidebar-tab.active {
  background: var(--accent);
  color: #fff;
}

/* ?????惜?” */
.store-sidebar-tag-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-sidebar-tag-tab {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.store-sidebar-tag-tab:hover {
  background: var(--accent);
}

.store-sidebar-tag-tab:hover .store-sidebar-tag-select,
.store-sidebar-tag-tab:hover .store-sidebar-tag-drag,
.store-sidebar-tag-tab:hover .store-sidebar-tag-action {
  color: #fff;
}

.store-sidebar-tag-tab.active {
  background: var(--accent);
}

.store-sidebar-tag-tab.active .store-sidebar-tag-select {
  color: #fff;
  font-weight: 500;
}

.store-sidebar-tag-tab.active .store-sidebar-tag-drag,
.store-sidebar-tag-tab.active .store-sidebar-tag-action {
  color: rgba(255, 255, 255, 0.75);
}

.store-sidebar-tag-drag {
  width: 22px;
  flex-shrink: 0;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: grab;
  font-size: 13px;
}

.store-sidebar-tag-select {
  flex: 1;
  padding: 9px 6px;
  background: transparent;
  border: none;
  color: var(--brown);
  font-size: 18px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.store-sidebar-tag-actions {
  display: flex;
  flex-shrink: 0;
}

.store-sidebar-tag-action {
  width: 26px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.store-sidebar-tag-action:hover {
  color: var(--accent-dark);
}

.store-sidebar-tag-action.danger:hover {
  color: rgba(237, 112, 77);
}
/*新增菜單分類按鈕*/
.store-sidebar-add {
  width: 100%;
  padding: 9px 12px;
  margin-top: 4px;
  background: #f4f8f2;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
}

.store-sidebar-save {
  margin-top: auto;
  padding-top: 16px;
  width: 100%;
}

.store-editor-content {
  padding: 24px 28px;
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  border: 1px solid var(--line);
  border-left: none;
  min-height: calc(100vh - 160px);
}

.store-editor-panel {
  display: block;
}

.store-sidebar-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .store-editor-wrap {
    grid-template-columns: 1fr;
  }
  .store-editor-sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line);
    border-radius: 10px 10px 0 0;
    padding: 10px 8px;
    gap: 6px;
    background: #f4f8f2;
  }
  .store-sidebar-tab {
    display: inline-flex;
    width: auto;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--line);
  }
  .store-sidebar-tab:hover {
    background: #e8f2eb;
    color: var(--accent-dark);
    border-color: var(--accent);
  }
  .store-sidebar-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .store-sidebar-header {
    width: 100%;
    border-bottom: none;
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  .store-sidebar-save {
    width: 100%;
    margin-top: 8px;
    padding-top: 0;
  }
  .store-editor-content {
    border-radius: 0 0 10px 10px;
    border-left: 1px solid var(--line);
    border-top: none;
    padding: 16px;
  }
  .store-sidebar-tag-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .store-sidebar-tag-tab {
    width: auto;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: #fff;
    overflow: visible;
  }
  .store-sidebar-tag-tab:hover {
    background: #e8f2eb;
    border-color: var(--accent);
  }
  .store-sidebar-tag-tab:hover .store-sidebar-tag-select,
  .store-sidebar-tag-tab:hover .store-sidebar-tag-drag,
  .store-sidebar-tag-tab:hover .store-sidebar-tag-action {
    color: var(--accent-dark);
  }
  .store-sidebar-tag-tab.active {
    background: var(--accent);
    border-color: var(--accent);
  }
  .store-sidebar-tag-tab.active .store-sidebar-tag-select {
    color: #fff;
  }
  .store-sidebar-tag-tab.active .store-sidebar-tag-drag,
  .store-sidebar-tag-tab.active .store-sidebar-tag-action {
    color: rgba(255, 255, 255, 0.8);
  }
  .store-sidebar-tag-select {
    max-width: none;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 4px 6px 8px;
  }
  .store-sidebar-tag-drag {
    padding: 6px 2px 6px 4px;
    font-size: 12px;
  }
}

/* 摨振鞈??Ｘ嚗?脣??身摰?嚗?*/
.store-info-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}

.store-info-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.store-info-form input[type="text"],
.store-info-form input[type="tel"] {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: var(--panel);
  color: var(--ink);
  width: 100%;
    font-weight:300

  }

.store-info-form input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
  font-weight:300
}

/* ?? ???賊? Modal ?????????????????????????????????????????????? */
.item-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 600px) {
  .item-modal-overlay {
    align-items: center;
  }
}

.item-modal-box {
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.18);
}

@media (min-width: 600px) {
  .item-modal-box {
    border-radius: 16px;
    max-height: 85vh;
  }
}

.item-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-modal-header h3 {
  font-size: 25px;
  font-weight: 500;
  margin: 0 0 4px;
}

.item-modal-desc {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 4px;
}

.item-modal-price {
  font-size: 1.5em;
  font-weight: 600;
  color: var(--sun);
  margin: 0;
  white-space: nowrap;
}

.item-modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-modal-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-weight: 500;
}

.item-modal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.item-modal-footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-modal-confirm-btn {
  flex-shrink: 0;
  width: 90px;
  min-width: unset;
}

.item-modal-qty {
  flex-shrink: 0;
}

/* Compact customer item card */
.customer-item-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
}

.customer-item-compact:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(74, 130, 82, 0.1);
}

.customer-item-compact.has-selection {
  border-color: var(--accent);
  background: #f0f9f4;
}

.customer-item-compact-info {
  flex: 1;
  min-width: 0;
}

.customer-item-compact-info strong {
  display: block;
  font-size: 20px;
}

.customer-item-compact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.customer-item-compact-tag {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

.customer-item-compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ?犖閮?∠?摨8嚗?憿?甈曄?????*/
.person-order-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.person-order-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-right: 2px;
}

.person-order-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ?? 閮?敦?惜 ?????????????????????????????????????????????? */
.detail-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}

.detail-tab {
  padding: 10px 22px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.detail-tab:hover {
  background: transparent;
  color: #e69900;
  border-bottom: 3px solid #e69900;
}

.detail-tab.active {
  background: transparent;
  color: #e69900;
  border-bottom: 3px solid #e69900;
}

/* 敶鋆∠???蝢斤? */
.aggregate-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.aggregate-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f4f8f2;
  font-weight: 800;
  font-size: 15px;
}

.aggregate-group-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.aggregate-group-entry-left {
  flex: 1;
  min-width: 0;
}

.aggregate-group-entry-opts {
  color: var(--muted);
  margin-top: 2px;
}

.aggregate-group-entry-who {
  font-size: 12px;
  color: var(--accent-dark);
  font-weight: 700;
  margin-top: 2px;
}

/* 彙整訂單表格*/
.aggregate-table {
  width: 100%;
  border-collapse: collapse;
}

.aggregate-table thead th {
  background: var(--green);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 20px;
  color: var(--brown);
  text-align: left;
  white-space: nowrap;
}

.aggregate-table tbody tr:not(.bag-divider) td {
  font-weight: 400;
  font-size: 20px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--brown);
}

.aggregate-table tbody tr.row-hover {
  background: rgba(248, 245, 232);
}

.aggregate-table .specs-cell {
  color: var(--brown);
  max-width: 220px;
}

.aggregate-table tr.bag-divider td {
  padding: 6px 10px;
  background: #edf5e9;
  font-weight: 500;
  color: var(--accent-dark);
  text-align: center;
  letter-spacing: 1px;
  font-size: 18px;
}

.aggregate-table tr.subtotal-row td {
  background: #f4f8f2;
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 6px 10px;
}

/* 主頁籤 */
.main-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
}

.main-tab {
  padding: 10px 28px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 100%;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.main-tab:hover {
  background: transparent;
  color: #e69900;
  border-bottom: 3px solid #e69900;
}
.main-tab.active {
  background: transparent;
  color: #e69900;
  border-bottom: 3px solid #e69900;
}

/* 目前訂購表單 */
.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.list-table thead th {
  background: var(--green);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 20px;
  color: var(--brown);
  text-align: left;
  white-space: nowrap;
}

.list-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.list-table tbody tr:last-child {
  border-bottom: none;
}
.list-table tbody tr:hover {
  background: rgba(248, 245, 232);
}

.list-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* ── 訂購頁：左側菜單分類 sidebar 佈局 ─────────────────────────── */
.order-main-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.order-header-panel {
  margin-bottom: 12px;
}

.menu-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(36, 57, 42, 0.08);
  overflow: hidden;
}

.menu-sidebar {
  background: #f4f8f2;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  min-height: 200px;
  width: 250px;
}

.menu-sidebar-tab {
  display: block;
  width: calc(100% - 16px);
  margin: 2px 8px;
  text-align: left;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 999px;
  font-size: 100%;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-sidebar-tab:hover {
  background: var(--accent);
  color: #fff;
}

.menu-sidebar-tab.active {
  background: var(--accent, #1f5c30);
  color: #fff;
}

.menu-items-col {
  padding: 16px 20px;
  min-width: 0;
  font-size: 18px;
}

.menu-items-col .item-list {
  margin-top: 0;
  font-size: 100%;
}

@media (max-width: 600px) {
  .menu-layout {
    grid-template-columns: 1fr;
    overflow: visible;
    border-radius: 10px;
  }
  .menu-sidebar {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
    border-bottom: 1px solid var(--line);
    min-height: auto;
    width: 100%;
    padding: 6px 8px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #f4f8f2;
    border-radius: 10px 10px 0 0;
  }
  .menu-sidebar-tab {
    display: inline-block;
    width: auto;
    margin: 0;
    border-radius: 999px;
    border-bottom: none;
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: left;
  }
  .menu-sidebar-tab.active {
    background: var(--accent-dark, #1f5c30);
    color: #fff;
    font-weight: 800;
  }
  .menu-items-col {
    padding: 12px 10px;
  }
  /* 品項卡片佔滿、移除左側縮排 */
  .customer-item-compact {
    width: 100%;
    margin: 0;
  }
  /* 隱藏綠色圓形＋按鈕 */
  [data-open-item-modal-plus] {
    display: none !important;
  }
}

/* ── 個人訂單表格樣式修正 ────────────────────────────────────── */
.submissions-table {
  border-radius: 10px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  width: 100%;
}

.submissions-table thead tr {
  background: #c8ddd0;
}

.submissions-table tbody tr {
  background: #ffffff;
}

.submissions-table tbody tr.group-hover {
  background: rgba(248, 245, 232);
}

.submissions-table th,
.submissions-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.submissions-table tbody tr:last-child td {
  border-bottom: none;
}

/* 修正一般 aggregate-table 的 tbody 行背景（若有需要） */
.aggregate-table tbody tr {
  background: #ffffff;
}

/* ── 店家列表 ─────────────────────────── */
.store-body-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
/* ── 店家列表：左側分類 sidebar ─────────────────────────── */
.store-sidebar {
  background: #f4f8f2;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(36, 57, 42, 0.06);
}

.store-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
  background: #f4f8f2;
}

.store-sidebar-head .item-section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.store-sidebar-head .menu-tag-add {
  font-size: 12px;
  padding: 3px 8px;
  background: #f4f8f2;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
}

.store-cat-sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 8px;
  background: #f4f8f2;
}

/* 圖3 樣式：圓角區塊帶拖曳/筆/X */
.store-cat-tab {
  display: flex;
  align-items: center;
  border-left: none;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
  transition: background 0.12s;
  padding: 0;
}

.store-cat-tab:hover {
  background: var(--accent);
}

.store-cat-tab:hover .store-cat-select,
.store-cat-tab:hover .store-cat-drag-btn,
.store-cat-tab:hover .store-cat-actions .menu-tag-action {
  color: #fff;
}

.store-cat-tab.active {
  background: var(--accent);
  border-left-color: transparent;
}

.store-cat-tab.active .store-cat-select {
  color: #fff;
  font-weight: 700;
}

.store-cat-tab.active .store-cat-drag-btn,
.store-cat-tab.active .store-cat-actions .menu-tag-action {
  color: rgba(255, 255, 255, 0.8);
}

.store-cat-tab + .store-cat-tab {
  border-top: none;
}

/* 左側拖曳符號：常態顯示 */
.store-cat-drag-btn {
  flex-shrink: 0;
  width: 22px;
  height: 100%;
  padding: 9px 3px 9px 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  pointer-events: auto;
}

.store-cat-select {
  flex: 1;
  text-align: left;
  padding: 9px 4px 9px 2px;
  background: transparent;
  border: none;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  max-width: 120px;
}

.store-cat-tab.active .store-cat-select {
  color: #fff;
  font-weight: 700;
}

/* 右側編輯/刪除：hover 或 active 才顯示 */
.store-cat-actions {
  display: flex;
  gap: 0;
  padding-right: 4px;
  opacity: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
  pointer-events: auto;
}

.store-cat-tab:hover .store-cat-actions,
.store-cat-tab.active .store-cat-actions {
  opacity: 1;
  pointer-events: auto;
}

.store-cat-actions .menu-tag-action {
  width: 24px;
  height: 24px;
  font-size: 13px;
  padding: 0;
  border-radius: 4px;
  line-height: 1;
  background: transparent;
  color: var(--brown);
  pointer-events: auto;
  cursor: pointer;
}

/* active / hover 時按鈕變白 */
.store-cat-tab.active .store-cat-actions .menu-tag-action,
.store-cat-tab:hover .store-cat-actions .menu-tag-action {
  color: rgba(255, 255, 255, 0.8);
}

.store-main {
  min-width: 0;
}

@media (max-width: 700px) {
  .main-tab{
font-size:90%
}
.store-body-layout {
    grid-template-columns: 1fr;
  }
  .store-cat-sidebar-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px;
    gap: 4px;
  }
  .store-cat-tab {
    border-radius: 999px;
    background: #eef4ec;
    padding: 0 4px 0 0;
  }
  .store-cat-tab.active {
    background: var(--accent);
  }
  .store-cat-tab.active .store-cat-select {
    color: #fff;
  }
  .store-cat-select {
    padding: 6px 4px 6px 10px;
    font-size: 13px;
  }
  .store-cat-actions {
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════════════════
   手機卡片式元件（list-table & aggregate 共用）
   ══════════════════════════════════════════════════════════════════ */

/* ── list-table 訂購列表卡片 ─────────────────────────────────────── */
.lt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(36, 57, 42, 0.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.lt-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 10px;
  background: #f8fbf6;
  border-bottom: 1px solid var(--line);
}

.lt-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--brown);
  flex: 1;
}

.lt-card-note {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  width: 100%;
}

.lt-card-rows {
  padding: 8px 14px;
}

.lt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.lt-row:last-child {
  border-bottom: none;
}

.lt-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 52px;
  flex-shrink: 0;
}

.lt-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 12px;
  background: #f8fbf6;
  border-top: 1px solid var(--line);
}

/* ── aggregate 彙整卡片 ─────────────────────────────────────────── */
.agg-bag-divider {
  background: #edf5e9;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  margin: 14px 0 6px;
}

.agg-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(36, 57, 42, 0.08);
  margin-bottom: 10px;
  overflow: hidden;
}

.agg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fbf6;
}

.agg-card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--brown);
}

.agg-card-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.agg-card-item:last-of-type {
  border-bottom: none;
}

.agg-card-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.agg-card-item-specs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 3px;
}

.agg-card-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  margin-top: 4px;
}

.agg-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agg-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 12px;
  background: #f8fbf6;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.agg-card-subtotal {
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

.agg-card-subtotal strong {
  color: var(--sun);
  font-size: 17px;
  margin-left: 4px;
}

.agg-card-payment {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
  gap: 6px;
}

/* ── 是/否 切換組 ───────────────────────────────────────────────── */
.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  font-size: 14px;
}

.toggle-group-label {
  padding: 5px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.toggle-opt {
  padding: 5px 12px;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.12s,
    color 0.12s;
}

.toggle-opt:first-of-type {
  border-left: none;
}

.toggle-opt:hover {
  background: #e8f2eb;
  color: var(--accent-dark);
}

.toggle-opt.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
