:root {
  --bg-main: #f5f3ea;
  --bg-card: rgba(255, 255, 255, 0.88);
  --text-main: #16212f;
  --text-soft: #4f5f73;
  --primary: #0e7c7b;
  --primary-strong: #0a5d5c;
  --accent: #e07a2f;
  --danger: #b53131;
  --border: rgba(16, 33, 49, 0.14);
  --shadow: 0 16px 42px rgba(19, 31, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 20%, #fff4d6 0%, transparent 36%),
    radial-gradient(circle at 80% 5%, #d8f4ef 0%, transparent 33%),
    linear-gradient(180deg, #f8f6ef 0%, #f0ede3 100%);
  font-family: "Noto Sans TC", sans-serif;
}

h1,
h2,
h3 {
  margin: 0;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(44px);
  opacity: 0.36;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #f0b172;
  top: -90px;
  right: -60px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: #59b9ba;
  bottom: -100px;
  left: -80px;
}

.app-shell {
  width: min(1080px, 92vw);
  margin: 30px auto 42px;
}

.app-header {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.12;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 20px;
  background: rgba(255, 255, 255, 0.75);
}

.switch-btn {
  border: 0;
  background: transparent;
  color: var(--text-main);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
}

.switch-btn.active {
  background: var(--text-main);
  color: #fff;
}

.view {
  display: none;
  gap: 14px;
}

.view.active {
  display: grid;
}

.card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
  padding: 20px;
}

.card h2 {
  font-size: 1.24rem;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.field {
  width: 100%;
  border: 1px solid #cad3df;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font-size: 0.96rem;
}

.textarea {
  min-height: 145px;
  resize: vertical;
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.restaurant-phone {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-weight: 700;
}

.restaurant-address {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-weight: 700;
}

.item-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.item-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-card input {
  width: 18px;
  height: 18px;
}

.item-title {
  margin: 0;
  font-weight: 700;
}

.item-price {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.summary-box {
  border: 1px dashed #b8c2ce;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fffdfa;
  margin-bottom: 12px;
  min-height: 70px;
}

button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-strong);
}

.secondary-btn {
  background: #ebf4f7;
  color: #13324d;
}

.secondary-btn:hover {
  background: #dcecf2;
}

.danger-btn {
  background: #ffe8e8;
  color: var(--danger);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.stat-chip {
  background: #f4f7ff;
  border: 1px solid #d8dfef;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  padding: 9px 10px;
  font-size: 0.93rem;
}

th {
  background: #f7f9fc;
}

.message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.orders-list {
  display: grid;
  gap: 10px;
}

.order-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.hint {
  margin-top: 0;
  color: var(--text-soft);
}

.reveal {
  opacity: 0;
  transform: translateY(9px);
  animation: reveal 0.45s ease forwards;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

.delay-3 {
  animation-delay: 0.24s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(1080px, 95vw);
    margin-top: 18px;
  }

  .switch-btn {
    padding: 10px 14px;
  }
}
