:root {
  --bg: #fdf8ec;
  --surface: #ffffff;
  --primary: #f5df4d;
  --primary-deep: #b8912a;
  --primary-tint: #fbf3d4;
  --text: #6b4e31;
  --text-muted: #a3876a;
  --border: #ece0c4;
  --danger: #b23a2e;
  --danger-tint: #f7e6e3;
  --success: #57794f;
  --success-tint: #e9f0e6;
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Fraunces", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-body: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.page-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  box-sizing: border-box;
}

.page-container.wide { max-width: 960px; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: 600;
  margin: 0;
}
h1 { font-size: 24px; }
h2 { font-size: 17px; }

.sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.note {
  background: var(--primary-tint);
  color: var(--text);
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(107, 78, 49, 0.04);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-primary { background: var(--primary); color: var(--text); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }

/* ---- Forms ---- */
label { display: block; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--text); }
input[type="text"], input[type="date"], input[type="time"], input[type="number"],
input[type="tel"], input[type="password"], input[type="file"], input[type="email"],
input[type="datetime-local"], input[type="url"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-body);
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-deep);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
input[readonly] { background: #f6f1e2; color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check-row input { width: 18px; height: 18px; margin: 0; }
.check-row label { margin: 0; font-weight: 400; }

/* ---- Stamp-style status badge ---- */
.stamp {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  letter-spacing: 0.02em;
}
.stamp-pending { color: var(--primary-deep); background: var(--primary-tint); }
.stamp-approved { color: var(--success); background: var(--success-tint); }
.stamp-rejected { color: var(--danger); background: var(--danger-tint); }

/* ---- List rows (overview pattern) ---- */
.list-toolbar { display: flex; gap: 10px; align-items: center; margin: 18px 0 10px; flex-wrap: wrap; }
.list-toolbar input[type="text"] { margin-top: 0; flex: 1; min-width: 160px; }

.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar > * { margin-top: 0 !important; }
.filter-bar label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; margin: 0; }
.filter-bar input[type="date"], .filter-bar select { width: auto; min-width: 130px; }
.filter-bar .btn-clear-filter { background: none; border: none; color: var(--text-muted); font-size: 12.5px; text-decoration: underline; cursor: pointer; padding: 4px; }
.list-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.list-row-main { font-size: 14px; color: var(--text); line-height: 1.6; }
.list-row-actions { display: flex; gap: 8px; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

#status { margin-top: 12px; text-align: center; font-size: 14px; color: var(--text); }
.editing-banner {
  background: var(--primary-tint);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

/* 覆蓋瀏覽器「自動填入/已儲存密碼」欄位的預設藍底色，改成跟品牌一致 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--surface) inset;
  box-shadow: 0 0 0px 1000px var(--surface) inset;
  transition: background-color 9999s ease-in-out 0s;
}
