/* 会計画面固有のスタイル */
.table-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.table-btn {
  padding: 16px 8px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-btn:hover {
  border-color: var(--color-checkout);
  color: var(--color-checkout);
  transform: translateY(-2px);
}

.table-btn.active {
  background: var(--color-checkout);
  border-color: var(--color-checkout);
  color: #fff;
  transform: scale(1.02);
}

.table-btn.has-order {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #92400e;
  animation: pulse-order 2s infinite;
}

@keyframes pulse-order {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

.table-btn.has-order.active {
  background: var(--color-checkout);
  border-color: var(--color-checkout);
  color: #fff;
  animation: none;
}

.order-list {
  margin-bottom: 16px;
}

.order-group {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.order-group-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item.deleted {
  opacity: 0.4;
  text-decoration: line-through;
}

.order-item-info {
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.order-item-unit-price {
  font-size: 0.75rem;
  color: #64748b;
}

.order-item-qty {
  color: #64748b;
  font-size: 0.875rem;
  margin-left: 8px;
}

.order-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-qty-btn:hover {
  background: #cbd5e1;
}

.order-qty-btn.minus {
  background: #fee2e2;
  color: #ef4444;
}

.order-qty-btn.minus:hover {
  background: #fecaca;
}

.order-qty-btn.plus {
  background: #dcfce7;
  color: #16a34a;
}

.order-qty-btn.plus:hover {
  background: #bbf7d0;
}

.order-item-qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.order-item-price {
  font-weight: 700;
  min-width: 70px;
  text-align: right;
  color: var(--color-checkout);
}

.total-section {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.total-row:last-child {
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid #475569;
  font-size: 1.75rem;
  font-weight: 700;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.payment-btn {
  padding: 18px 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-btn:hover {
  border-color: var(--color-checkout);
  color: var(--color-checkout);
}

.payment-btn.active {
  background: var(--color-checkout);
  border-color: var(--color-checkout);
  color: #fff;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.history-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.history-item:hover {
  box-shadow: var(--shadow);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-table {
  font-weight: 700;
  color: var(--color-checkout);
  font-size: 1rem;
}

.history-time {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.history-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-total {
  font-size: 1.25rem;
  font-weight: 700;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.order-delete-btn {
  padding: 4px 10px;
  background: #fee2e2;
  border: none;
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.order-delete-btn:hover {
  background: #fecaca;
}

/* 預かり金額入力 */
.cash-input-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.cash-input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cash-input-row:last-child {
  margin-bottom: 0;
}

.cash-input-label {
  font-weight: 600;
  color: #475569;
}

.cash-input-value {
  font-weight: 700;
  font-size: 1.25rem;
}

.cash-input-value.change-positive {
  color: var(--color-checkout);
}

.cash-input-value.change-negative {
  color: #ef4444;
}

.cash-amount-input {
  width: 140px;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: right;
}

.cash-amount-input:focus {
  outline: none;
  border-color: var(--color-checkout);
}

/* 履歴詳細モーダル */
.history-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-detail-items {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.history-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
}

.history-detail-item:last-child {
  border-bottom: none;
}

.history-detail-item.deleted {
  opacity: 0.4;
  text-decoration: line-through;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.history-item-unit-price {
  font-size: 0.75rem;
  color: #64748b;
}

.history-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-qty-btn:hover {
  background: #cbd5e1;
}

.history-qty-btn.minus {
  background: #fee2e2;
  color: #ef4444;
}

.history-qty-btn.minus:hover {
  background: #fecaca;
}

.history-qty-btn.plus {
  background: #dcfce7;
  color: #16a34a;
}

.history-qty-btn.plus:hover {
  background: #bbf7d0;
}

.history-item-qty {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.history-item-subtotal {
  min-width: 70px;
  text-align: right;
  font-weight: 700;
  font-size: 0.875rem;
}

.history-checkout-number {
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 600;
}

.history-delete-btn {
  padding: 6px 10px;
  background: #fee2e2;
  border: none;
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.history-delete-btn:hover {
  background: #fecaca;
}
