
@font-face {
  font-family: "源泉圓體H";
  src: url('/GenSenRounded2-H.ttc') format('truetype');
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #9ca3af;
  --line: #e5e7eb;
  --panel: #ffffff;
  --soft: #f6f7f9;
  --accent: #4D7A94;
  --accent-dark: #3d667d;
  --success: #087f5b;
  --danger: #b42318;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 49% 22%, rgba(77, 122, 148, 0.3), transparent 18rem),
    radial-gradient(circle at 38% 62%, rgba(146, 207, 232, 0.28), transparent 17rem),
    radial-gradient(circle at 64% 66%, rgba(216, 168, 240, 0.24), transparent 18rem),
    linear-gradient(180deg, #fbfdff 0%, #ffffff 54%, #f2f7fa 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 54px 28px 72px;
}

.shell::before,
.shell::after {
  content: "";
  position: fixed;
  pointer-events: none;
  opacity: 0.5;
}

.shell::before {
  right: 10vw;
  bottom: 14vh;
  width: 84px;
  height: 84px;
  background:
    linear-gradient(45deg, transparent 44%, rgba(255, 255, 255, 0.95) 48%, transparent 53%),
    linear-gradient(-45deg, transparent 44%, rgba(255, 255, 255, 0.95) 48%, transparent 53%);
  filter: drop-shadow(0 0 14px rgba(178, 216, 232, 0.8));
}

.shell::after {
  left: 20vw;
  bottom: 8vh;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 30px rgba(201, 223, 238, 0.8);
}

.adminHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 148px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.closeButton svg,
.searchField svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brandLogo {
  width: clamp(160px, 18vw, 220px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 22px rgba(77, 122, 148, 0.16));
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand h1 strong {
  color: var(--accent);
  font-weight: 900;
}

.closeButton,
.ghostButton {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(77, 122, 148, 0.18);
  cursor: pointer;
}

.closeButton {
  position: absolute;
  top: 8px;
  right: clamp(170px, 22vw, 255px);
  width: 56px;
  height: 56px;
  border-radius: 32px;
  color: #7f8da0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(129, 177, 200, 0.78) 34%, rgba(77, 122, 148, 0.95) 58%, rgba(228, 188, 239, 0.86) 100%);
  box-shadow:
    0 10px 26px rgba(77, 122, 148, 0.2),
    inset 0 2px 8px rgba(255, 255, 255, 0.9),
    inset 0 -8px 16px rgba(30, 74, 96, 0.28);
}

.ghostButton {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 32px;
  font-weight: 850;
}

.hero {
  text-align: center;
  padding: 0 0 76px;
}

.hero h1 {
  margin: -8px 0 18px;
  color: #eef9fc;
  font-size: clamp(2.7rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: 0;
  font-family: "源泉圓體H", "Arial Rounded MT Bold", "PingFang TC", "Microsoft JhengHei", ui-rounded, system-ui, sans-serif;
  font-weight: 900;
  -webkit-text-stroke: 2.45px rgba(48, 88, 110, 0.72);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.78))
    drop-shadow(0 2px 4px rgba(48, 88, 110, 0.18));
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 1),
    0 1px 0 rgba(31, 68, 88, 0.2),
    1px 0 0 rgba(190, 102, 226, 0.1);
}

.hero p {
  width: min(760px, 100%);
  margin: 0 auto;
  color: #ecf8fb;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.7;
  font-family: "源泉圓體H", "Arial Rounded MT Bold", "PingFang TC", "Microsoft JhengHei", ui-rounded, system-ui, sans-serif;
  font-weight: 820;
  -webkit-text-stroke: 2.45px rgba(48, 88, 110, 0.72);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.78))
    drop-shadow(0 2px 4px rgba(48, 88, 110, 0.18));
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 1),
    0 1px 0 rgba(31, 68, 88, 0.2),
    1px 0 0 rgba(190, 102, 226, 0.1);
}

.lookupPanel,
.adminPanel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 26px 50px rgba(17, 24, 39, 0.08);
}

.lookupPanel {
  position: relative;
  width: min(100%, 560px);
  margin: -20px auto 0;
  padding: 30px;
  border: 1px solid rgba(216, 221, 226, 0.85);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(180, 213, 226, 0.44) 22%, rgba(77, 122, 148, 0.34) 45%, rgba(245, 252, 255, 0.72) 67%, rgba(214, 169, 236, 0.4) 100%),
    radial-gradient(circle at 13% 17%, rgba(255, 255, 255, 0.92), transparent 10rem),
    radial-gradient(circle at 86% 78%, rgba(255, 218, 237, 0.62), transparent 12rem);
  box-shadow:
    0 28px 52px rgba(45, 86, 106, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -12px 24px rgba(77, 122, 148, 0.12);
  backdrop-filter: blur(8px);
}

.searchField {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border: 1px solid rgba(77, 122, 148, 0.32);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(208, 229, 237, 0.58) 38%, rgba(255, 255, 255, 0.82) 64%, rgba(225, 200, 237, 0.42));
  color: #4D7A94;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.84),
    inset 0 -6px 12px rgba(77, 122, 148, 0.1),
    0 8px 18px rgba(77, 122, 148, 0.12);
}

.secondaryField {
  margin-top: 14px;
}

.fieldIcon {
  width: 30px;
  flex: none;
  color: #d7e9ef;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 950;
  text-align: center;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.96),
    0 1px 0 rgba(42, 84, 104, 0.3),
    0 4px 9px rgba(77, 122, 148, 0.2);
}

.searchField input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #4D7A94;
  font-size: clamp(1rem, 2vw, 1.12rem);
  font-weight: 950;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(38, 78, 98, 0.2),
    0 4px 9px rgba(77, 122, 148, 0.16);
}

.searchField input::placeholder {
  color: #b4cad5;
  opacity: 1;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.92),
    0 1px 0 rgba(44, 88, 108, 0.16);
}

.captchaBlock {
  margin-top: 16px;
}

.captchaBlock p {
  margin: 0 0 10px;
  color: #21384a;
  font-size: 0.82rem;
  font-weight: 950;
  text-align: left;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82),
    0 3px 7px rgba(77, 122, 148, 0.2);
}

.captchaRow {
  display: grid;
  grid-template-columns: 132px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.captchaImage {
  width: 100%;
  height: 54px;
  border: 1px solid rgba(77, 122, 148, 0.22);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(208, 229, 237, 0.54), rgba(225, 200, 237, 0.38));
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 255, 0.78),
    inset 0 -5px 10px rgba(77, 122, 148, 0.1);
  object-fit: cover;
}

.captchaRefresh {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 122, 148, 0.22);
  border-radius: 32px;
  color: #4D7A94;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(187, 217, 229, 0.66), rgba(225, 200, 237, 0.44));
  box-shadow:
    0 8px 16px rgba(77, 122, 148, 0.12),
    inset 0 2px 6px rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.captchaRefresh svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.captchaInput {
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(77, 122, 148, 0.32);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(208, 229, 237, 0.58) 38%, rgba(255, 255, 255, 0.82) 64%, rgba(225, 200, 237, 0.42));
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.84),
    inset 0 -6px 12px rgba(77, 122, 148, 0.1);
}

.captchaInput input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 20px;
  background: transparent;
  color: #4D7A94;
  font-weight: 950;
  text-transform: uppercase;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(38, 78, 98, 0.2);
}

.captchaInput input::placeholder {
  color: #b4cad5;
}

.turnstileWrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 10px;
}

.submitButton {
  width: 100%;
  min-height: 64px;
  margin-top: 20px;
  border: 0;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 18%),
    linear-gradient(135deg, #b7d4df 0%, #4D7A94 28%, #2e6179 52%, #76a7ba 74%, #4D7A94 100%);
  color: #e9f7fb;
  font-size: clamp(1.06rem, 2vw, 1.24rem);
  font-weight: 950;
  cursor: pointer;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.78),
    0 2px 0 rgba(20, 55, 72, 0.46),
    0 5px 10px rgba(20, 61, 82, 0.22);
  box-shadow:
    0 16px 28px rgba(77, 122, 148, 0.26),
    inset 0 2px 7px rgba(255, 255, 255, 0.5),
    inset 0 -10px 20px rgba(25, 67, 88, 0.34);
}

.submitButton.compact {
  min-height: 54px;
  margin-top: 8px;
  border-radius: 32px;
  font-size: 1rem;
}

.statusMessage {
  margin-top: 24px;
  color: #d7e9ef;
  font-weight: 950;
  text-align: center;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.92),
    0 1px 0 rgba(37, 80, 101, 0.28),
    0 4px 9px rgba(77, 122, 148, 0.18);
}

.statusMessage[data-type="success"] {
  color: var(--success);
}

.statusMessage[data-type="error"] {
  color: var(--danger);
}

.statusMessage[data-type="empty"],
.statusMessage[data-type="loading"] {
  color: #6b7280;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.orderCard {
  border: 1px solid rgba(77, 122, 148, 0.24);
  border-radius: 16px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(211, 231, 239, 0.56), rgba(255, 255, 255, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 28px rgba(77, 122, 148, 0.12);
}

.orderHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.label,
dt {
  color: #3d6a7e;
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.orderHead h3 {
  margin: 6px 0 0;
  color: #1a3a4a;
  font-size: 1.55rem;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 5px 10px rgba(77, 122, 148, 0.15);
}

.pill {
  flex: none;
  border-radius: 999px;
  padding: 10px 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(159, 199, 216, 0.62), rgba(225, 194, 239, 0.52));
  color: #1e4558;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.orderGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

dd {
  margin: 4px 0 0;
  color: #4D7A94;
  font-weight: 950;
  overflow-wrap: anywhere;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.86),
    0 1px 0 rgba(37, 80, 101, 0.16);
}

dd a {
  color: var(--accent-dark);
}

.note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #4D7A94;
  line-height: 1.6;
  font-weight: 900;
  text-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.86),
    0 1px 0 rgba(37, 80, 101, 0.16);
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .shell {
    padding: 28px 16px 48px;
  }

  .topbar {
    min-height: 112px;
  }

  .brand { gap: 12px; }
  .brandLogo { width: 136px; }

  .closeButton {
    top: 4px;
    right: 18px;
    width: 46px;
    height: 46px;
  }

  .hero { padding: 0 0 48px; }
  .hero h1 { margin-top: 0; }

  .lookupPanel {
    padding: 22px 18px;
    border-radius: 32px;
  }

  .searchField { height: 56px; padding: 0 18px; gap: 14px; }
  .captchaRow { grid-template-columns: minmax(0, 1fr) 48px; }
  .captchaImage { height: 52px; }
  .captchaInput { grid-column: 1 / -1; }
  .submitButton { min-height: 60px; }
  .orderHead, .orderGrid { display: grid; grid-template-columns: 1fr; }
}

/* ── Admin Dashboard ── */
.adminApp {
  margin: 0;
  min-height: 100vh;
  background: #f0f0f5;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.appLayout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  background: #162331;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebarHeader {
  padding: 24px 20px 16px;
}

.sidebarLogo {
  width: 72px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.sidebarNav { flex: 1; padding: 4px 0; }

.navGroup { padding: 16px 0 4px; }

.navGroupLabel {
  display: block;
  padding: 0 20px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #3d6070;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.navItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #7aa0b2;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.navItem:hover { color: #c8dde8; background: rgba(255,255,255,0.04); }

.navItem.active {
  color: #d6eaf2;
  background: rgba(77, 122, 148, 0.14);
  border-left-color: #4D7A94;
}

.navItem svg {
  width: 16px; height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebarFooter {
  padding: 16px 20px;
  border-top: 1px solid #1c3446;
}

.sidebarEmail {
  display: block;
  font-size: 0.72rem;
  color: #3d6070;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 10px;
}

.logoutBtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #7aa0b2;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.logoutBtn:hover { background: rgba(255,255,255,0.1); color: #c8dde8; }

.logoutBtn svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mainArea {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s;
}

.adminTopbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  background: white;
  border-bottom: 1px solid #e8e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.adminTopbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0;
}

.adminContent {
  flex: 1;
  padding: 24px 28px;
}

/* Login */
.loginWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
}

.loginCard {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  display: grid;
  gap: 18px;
}

.loginCard h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Stats */
.statsRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.statCard {
  background: white;
  border-radius: 12px;
  padding: 22px;
  border: 1px solid #e8e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.statCardIcon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.statCardIcon svg path,
.statCardIcon svg rect,
.statCardIcon svg circle,
.statCardIcon svg ellipse,
.statCardIcon svg polyline,
.statCardIcon svg line,
.statCardIcon svg polygon {
  fill: none;
  stroke: inherit;
}

.statCardLabel {
  font-size: 0.78rem;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statCardValue {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1;
}

/* Section head */
.sectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sectionHead h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Table card */
.tableCard {
  background: white;
  border-radius: 12px;
  border: 1px solid #e8e8f0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.searchBar {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f5;
}

.searchBar input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  color: #1a1a2e;
}

.searchBar select {
  width: 180px;
  padding: 9px 12px;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  background: white;
  color: #374151;
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

.searchBar input:focus {
  border-color: #4D7A94;
  box-shadow: 0 0 0 3px rgba(77, 122, 148,0.12);
}

.searchBar select:focus {
  border-color: #4D7A94;
  box-shadow: 0 0 0 3px rgba(77, 122, 148,0.12);
}

.bulkBar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf2f5;
  background: #f7fbfd;
}

.bulkBar[hidden] { display: none; }

.bulkBar span {
  color: #4D7A94;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.bulkBar input {
  width: min(260px, 38vw);
  padding: 8px 12px;
  border: 1px solid #d6e1e7;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

.secondaryBtn,
.dangerBtn {
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.secondaryBtn {
  color: #4D7A94;
  background: white;
  border: 1px solid #b9cfda;
}

.dangerBtn {
  color: #b42318;
  background: #fff5f5;
  border: 1px solid #f3b8b8;
}

.orderTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.orderTable th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #f0f0f5;
  background: #fafafa;
}

.orderTable td {
  padding: 13px 16px;
  border-bottom: 1px solid #f5f5f8;
  color: #374151;
  vertical-align: middle;
}

.orderTable tr:last-child td { border-bottom: none; }
.orderTable tr:hover td { background: #fafafe; }

.selectCol {
  width: 34px;
  padding-left: 14px !important;
  padding-right: 6px !important;
  text-align: center !important;
}

.rowCheck {
  width: 18px;
  height: 18px;
  accent-color: #4D7A94;
  cursor: pointer;
}

.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #4b5563;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid #f0f0f5;
}

.pageBtn {
  padding: 7px 16px;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  background: white;
  color: #374151;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.pageBtn:hover:not(:disabled) { background: #f5f5f8; }
.pageBtn:disabled { opacity: 0.38; cursor: not-allowed; }

/* Forms */
.formCard {
  background: white;
  border-radius: 12px;
  border: 1px solid #e8e8f0;
  padding: 28px;
  max-width: 680px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: grid;
  gap: 0;
}

.formCard h2 {
  margin: 0 0 22px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.formField {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.85rem;
}

.formField.fullWidth { grid-column: 1 / -1; }

.formField input,
.formField textarea,
.formField select {
  padding: 10px 12px;
  border: 1px solid #e0e0ea;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  color: #1a1a2e;
  background: white;
  width: 100%;
  box-sizing: border-box;
}

.formField select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234D7A94' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.formField input:focus,
.formField textarea:focus,
.formField select:focus {
  border-color: #4D7A94;
  box-shadow: 0 0 0 3px rgba(77, 122, 148,0.12);
}

.primaryBtn {
  padding: 10px 22px;
  background: #4D7A94;
  color: white;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  align-self: start;
}

.primaryBtn:hover { background: #3d667d; }

.helpText {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.6;
}

/* Admin message in topbar */
.adminMsg {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  display: none;
}

.adminMsg[data-type="success"] { background: #ecfdf5; color: #065f46; display: block; }
.adminMsg[data-type="error"] { background: #fef2f2; color: #991b1b; display: block; }
.adminMsg[data-type="loading"] { background: #f0f9ff; color: #075985; display: block; }
.adminMsg[data-type="empty"] { background: #f9fafb; color: #6b7280; display: block; }

.emptyState {
  padding: 48px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

.editBtn {
  padding: 4px 12px;
  border: 1px solid #d0dde4;
  border-radius: 6px;
  background: white;
  color: #4D7A94;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.editBtn:hover { background: #f0f6f9; border-color: #4D7A94; }

.ocrDropzone {
  border: 2px dashed #d0dde4;
  border-radius: 10px;
  padding: 14px 18px;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ocrDropzone:hover, .ocrDropzone.dragover {
  border-color: #4D7A94;
  background: #f0f6f9;
}
.ocrDropzoneRow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ocrDropzone.hasImage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
}

.ocrPreview {
  display: none !important;
  max-width: 0;
  max-height: 0;
}

.ocrFileBadge {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d0dde4;
  border-radius: 10px;
  background: white;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 700;
}
.ocrFileBadge[hidden] { display: none; }
.ocrFileBadge span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ocrFileIcon {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #4D7A94;
  color: white;
  font-size: 0.72rem;
}

.adminOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.adminOverlay[hidden] { display: none !important; }
.adminModal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.adminModalHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e8ecf0;
  gap: 12px;
}
.adminModalLabel { font-size: 0.72rem; font-weight: 700; color: #9ca3af; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.adminModalId { font-size: 1rem; font-weight: 800; color: #1a3a4a; font-family: monospace; }
.adminModalClose {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
}
.adminModalClose:hover { background: #f3f4f6; color: #374151; }
.adminModalBody { padding: 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.adminModalGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.adminModalField {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adminModalField span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adminModalField input,
.adminModalField select,
.adminModalField textarea {
  border: 1px solid #d0dde4;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 0.88rem;
  color: #1a3a4a;
  background: #f6f9fb;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.adminModalField input:focus,
.adminModalField select:focus,
.adminModalField textarea:focus {
  outline: none;
  border-color: #4D7A94;
  background: #fff;
}
.adminModalField textarea { resize: vertical; min-height: 60px; }
.adminModalFieldFull { grid-column: 1 / -1; }
.adminModalFooter {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e8ecf0;
  justify-content: flex-end;
}

.emailLink {
  color: #4D7A94;
  text-decoration: none;
  font-size: 0.82rem;
}
.emailLink:hover { text-decoration: underline; }

.projectCard {
  background: white;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.projectCard:hover { border-color: #4D7A94; box-shadow: 0 4px 16px rgba(77,122,148,0.12); }
.projectCardUrl { margin-top:8px; font-size:0.78rem; color:#4D7A94; font-family:monospace; }
.projectDetailGrid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.projectDetailGrid > div { min-width: 0; width: 100%; }
.projectDetailGrid .formCard { display: block; max-width: none; width: 100%; box-sizing: border-box; }
.productList { display: flex; flex-direction: column; gap: 8px; }
.productItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f6f9fb;
  border-radius: 8px;
  border: 1px solid #e0eaf0;
  transition: background .15s, border-color .15s;
}
.productThumb { width:64px!important; height:64px!important; object-fit:cover; border-radius:6px; flex-shrink:0; border:1px solid #e5e7eb; display:block; }
.dragHandle { cursor: grab; color: #b0c4ce; font-size: 1.2rem; padding: 0 8px 0 0; flex-shrink: 0; user-select: none; line-height: 1; }
.dragHandle:hover { color: #4D7A94; }
.productItem.dragging { opacity: 0.45; }
.productItem.dragOver { background: #eef4f8; border-color: #4D7A94; }

/* ── Hamburger button (hidden on desktop) ── */
.hamburgerBtn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburgerBtn:hover { background: #f3f4f6; }
.hamburgerBtn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebarOverlay[hidden] { display: none; }

@media (max-width: 768px) {
  /* Sidebar: hidden off-screen, slides in */
  .sidebar {
    transform: translateX(-220px);
    transition: transform 0.22s ease;
    z-index: 100;
  }
  .sidebar.sidebarOpen { transform: translateX(0); }

  .hamburgerBtn { display: flex; }
  .mainArea { margin-left: 0 !important; }
  .adminContent { padding: 8px; }
  .formCard { padding: 16px; }
  .adminTopbar { padding: 12px 14px; }

  /* Page title smaller */
  #pageTitle { font-size: 1rem; }

  /* Stats: 2 cols, compact */
  .statsRow { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .statCard { padding: 14px 12px; }
  .statCardIcon { width: 32px; height: 32px; margin-bottom: 8px; }
  .statCardValue { font-size: 1.5rem !important; }

  /* Orders management page: card layout */
  .tableCard { overflow: visible; }
  .orderTable { display: block; min-width: unset; }
  .orderTable thead { display: none; }
  .orderTable tbody { display: block; }
  .orderTable tr {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 3px 8px;
    padding: 12px 10px;
    border: 1px solid #e8e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    background: white;
  }
  .orderTable tr:hover td { background: transparent; }
  .orderTable td { display: block; border: none; padding: 0; font-size: 0.83rem; }
  /* col 1: checkbox */
  .orderTable td:nth-child(1) { grid-column: 1; grid-row: 1; display: flex; align-items: center; }
  /* col 2: email — row 1 middle */
  .orderTable td:nth-child(2) { grid-column: 2; grid-row: 1; font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* col 3: product — row 2, span full width */
  .orderTable td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; color: #4D7A94; padding-left: 36px; }
  /* col 4: order id — hide */
  .orderTable td:nth-child(4) { display: none; }
  /* col 5: customer name — row 3 */
  .orderTable td:nth-child(5) { grid-column: 1 / 3; grid-row: 3; color: #6b7280; padding-left: 36px; }
  /* col 6: status — row 1 right */
  .orderTable td:nth-child(6) { grid-column: 3; grid-row: 1; display: flex; align-items: center; }
  /* col 7,8,9: hide */
  .orderTable td:nth-child(7),
  .orderTable td:nth-child(8),
  .orderTable td:nth-child(9) { display: none; }

  /* Home recent orders: card layout (no horizontal scroll) */
  #recentOrdersCard { overflow: visible; }
  #recentOrdersCard .orderTable { display: block; min-width: unset; }
  #recentOrdersCard .orderTable thead { display: none; }
  #recentOrdersCard .orderTable tbody { display: block; }
  #recentOrdersCard .orderTable tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 12px;
    border: 1px solid #e8e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    background: white;
  }
  #recentOrdersCard .orderTable tr:hover td { background: transparent; }
  #recentOrdersCard .orderTable td {
    display: block;
    border: none;
    padding: 0;
    font-size: 0.83rem;
  }
  /* Email: row 1 col 1, bold */
  #recentOrdersCard .orderTable td:nth-child(1) { font-weight: 700; font-size: 0.9rem; grid-column: 1; grid-row: 1; }
  /* 商品名稱: row 2 full width */
  #recentOrdersCard .orderTable td:nth-child(2) { color: #4D7A94; grid-column: 1 / -1; grid-row: 2; font-weight: normal; }
  /* 下單平台 (id): hide */
  #recentOrdersCard .orderTable td:nth-child(3) { display: none !important; }
  /* 客戶名稱: row 3 col 1, grey */
  #recentOrdersCard .orderTable td:nth-child(4) { display: block; color: #6b7280; grid-column: 1; grid-row: 3; padding-left: 0; }
  /* 訂單狀態: row 1 col 2, top-right */
  #recentOrdersCard .orderTable td:nth-child(5) { grid-column: 2; grid-row: 1; display: flex; align-items: flex-start; justify-content: flex-end; color: inherit; padding-left: 0; }

  /* bulkBar: wrap */
  .bulkBar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .bulkBar input { width: 100%; }
  .bulkBar select { width: 100%; }

  /* Forms: single column */
  .formGrid { grid-template-columns: 1fr; }
  .fullWidth { grid-column: 1; }

  /* Project detail: single column */
  .projectDetailGrid { grid-template-columns: 1fr !important; }

  /* Modal: single column grid, full-width */
  .adminModal { max-width: 100%; border-radius: 12px; }
  .adminModalGrid { grid-template-columns: 1fr; }
  .adminModalFieldFull { grid-column: 1; }

  /* Search bar: stack */
  .searchBar { flex-wrap: wrap; gap: 8px; }
  .searchBar input { width: 100%; min-width: unset; }
  .searchBar select { width: 100%; min-width: unset; }
  .searchBar .primaryBtn { width: 100%; }
}

@media (max-width: 420px) {
  .statsRow { grid-template-columns: 1fr; }
}
