/* TURNKEY Studio — admin interface */

/* 自託管 Noto Sans TC（可變字重），讓繁體中文有舒適一致的閱讀體驗 */
@font-face {
  font-family: "Noto Sans TC VF";
  src: url("../fonts/NotoSansTC-VF.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #24312a;
  --ink-2: #38463d;
  --muted: #6f776f;
  --faint: #9aa197;
  --bg: #f3f0e8;
  --surface: #fffdf8;
  --surface-2: #f8f5ed;
  --line: #e3ded1;
  --line-strong: #d3ccba;
  --brand: #2f5d46;
  --brand-dark: #234535;
  --brand-deep: #1a3328;
  --brand-soft: #e6eee6;
  --accent: #b67040;
  --accent-soft: #f6e8dc;
  --danger: #a94438;
  --danger-soft: #f8e5e1;
  --warn: #90631f;
  --warn-soft: #fbf0da;
  --ok: #2f6b4f;
  --ok-soft: #e3f0e7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(34, 45, 37, .07);
  --shadow-sm: 0 4px 16px rgba(34, 45, 37, .06);
  --font-sans: "Noto Sans TC VF", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --font-serif: Georgia, "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(182, 112, 64, .07), transparent 60%),
    radial-gradient(760px 480px at 20% 110%, rgba(47, 93, 70, .06), transparent 60%),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-family: var(--font-serif); font-size: clamp(30px, 3.3vw, 46px); font-weight: 500; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
small { font-size: 12.5px; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ shell */
.admin-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  padding: 22px 16px 18px;
  color: rgba(255, 253, 248, .78);
  background:
    radial-gradient(420px 280px at 10% -8%, rgba(255, 255, 255, .09), transparent 70%),
    linear-gradient(165deg, #2f5d46 0%, #244635 48%, #1b352a 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  z-index: 40;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  opacity: .55;
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #f3efe3;
  color: var(--brand-dark);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(35, 69, 53, .15);
  overflow: hidden;
}
.brand-mark img, .brand-mark svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: .16em; color: #fffdf8; }
.brand-text small { font-size: 11px; letter-spacing: .14em; color: rgba(255, 253, 248, .55); margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-label {
  display: block;
  margin: 18px 12px 7px;
  font-size: 10.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: rgba(255, 253, 248, .4);
}
.side-label:first-child { margin-top: 4px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: rgba(255, 253, 248, .72);
  font-size: 13.5px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.side-link:hover { background: rgba(255, 255, 255, .07); color: #fffdf8; transform: translateX(1px); }
.side-link.active { background: rgba(255, 253, 248, .13); color: #fffdf8; box-shadow: inset 2px 0 0 #d8b98a; }
.side-icon { width: 18px; text-align: center; font-size: 14px; opacity: .8; }
.side-site {
  display: flex; align-items: center; gap: 10px;
  margin: 0 2px 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 253, 248, .12);
  border-radius: 11px;
  background: rgba(0, 0, 0, .1);
}
.side-site strong { display: block; color: #fffdf8; font-size: 13px; font-weight: 600; }
.side-site small { display: block; color: rgba(255, 253, 248, .45); font-size: 11px; font-family: var(--font-mono); }
.side-site-dot { width: 8px; height: 8px; border-radius: 50%; background: #d7a64d; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(215, 166, 77, .14); }
.side-site-dot.live { background: #7fc49a; box-shadow: 0 0 0 3px rgba(127, 196, 154, .14); }
.side-site-link { padding-left: 13px; font-size: 13px; }
.sidebar-foot { margin-top: auto; }
.sidebar-note {
  padding: 13px;
  border: 1px solid rgba(255, 253, 248, .1);
  border-radius: 11px;
  background: rgba(255, 253, 248, .04);
}
.sidebar-note strong { color: rgba(255, 253, 248, .8); font-size: 12px; }
.sidebar-note p { color: rgba(255, 253, 248, .45); font-size: 11.5px; margin-top: 3px; line-height: 1.5; }

.main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  min-height: 66px;
  padding: 12px 34px;
  background: rgba(243, 240, 232, .84);
  border-bottom: 1px solid rgba(211, 204, 186, .55);
  backdrop-filter: blur(14px);
}
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-crumb { font-size: 10px; letter-spacing: .18em; color: var(--faint); }
.topbar-current { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 9px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.mobile-only { display: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 10px; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(255, 253, 248, .7); }
.avatar {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fffdf8;
  font-weight: 700;
  font-size: 14px;
}
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: 12.5px; }
.user-meta small { color: var(--muted); font-size: 10.5px; }
.chev { color: var(--faint); font-size: 10px; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 180px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  z-index: 50;
}
.user-pop a, .user-pop button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2); font-size: 13px;
}
.user-pop a:hover, .user-pop button:hover { background: var(--surface-2); color: var(--brand); }
.user-pop form { margin: 0; }

.page { width: 100%; max-width: 1420px; margin: 0 auto; padding: 32px 34px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 26px; }
.page-head-copy { max-width: 800px; }
.eyebrow { margin: 0 0 9px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.page-sub { margin-top: 9px; max-width: 720px; color: var(--muted); font-size: 14px; }
.page-sub .mono { color: var(--ink-2); }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; padding-bottom: 4px; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fffdf8; box-shadow: 0 2px 0 rgba(26, 51, 40, .2); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fffdf8; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); }
.btn-light { background: #fffdf8; border-color: #fffdf8; color: var(--brand-dark); }
.btn-light:hover { color: var(--brand-dark); background: #f3efe3; }
.btn-outline-light { border-color: rgba(255, 253, 248, .42); color: #fffdf8; }
.btn-outline-light:hover { border-color: #fffdf8; color: #fffdf8; background: rgba(255, 255, 255, .08); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8d352b; color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(169, 68, 56, .24); background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.button-row.center { justify-content: center; }
.text-link { color: var(--brand); font-weight: 600; font-size: 13px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
}
.badge-brand { background: var(--accent-soft); color: #8b4f28; }
.badge-soft { background: var(--brand-soft); color: var(--brand); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #efede5; color: #7a7d74; }

/* ----------------------------------------------------------------- notices */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash, .notice {
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
}
.flash-success, .notice-success { background: var(--ok-soft); border-color: #c3ddcd; color: #255841; }
.flash-error, .notice-error { background: var(--danger-soft); border-color: #eccbc5; color: #80342b; }
.flash-warning, .notice-warn { background: var(--warn-soft); border-color: #ead7b3; color: #74501a; }
.flash-info, .notice-info { background: #e8eef3; border-color: #cfdce6; color: #33556b; }
.notice { margin-bottom: 18px; }
.notice ul { margin: 7px 0 0; padding-left: 18px; }
.notice p { margin-top: 6px; }
.notice summary { cursor: pointer; font-weight: 600; }
.notice .btn { margin-top: 12px; }

/* ------------------------------------------------------------------ panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel + .panel { margin-top: 18px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-head p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.panel-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel-subhead p { color: var(--muted); font-size: 12.5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.dashboard-side { display: flex; flex-direction: column; gap: 18px; }
.dashboard-side .panel + .panel { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack .panel + .panel { margin-top: 0; }
.edit-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 18px; align-items: start; }
.edit-side { display: flex; flex-direction: column; gap: 18px; }
.edit-side .panel + .panel { margin-top: 0; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* -------------------------------------------------------------- page header */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 0; }
.stat-card {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .05em; }
.stat-card strong { font-family: var(--font-serif); font-size: 28px; font-weight: 500; line-height: 1.2; }
.stat-card small { color: var(--faint); font-size: 10.5px; }
.stat-warn { background: #fff9ee; border-color: #ead7b3; }
.stat-soft { background: var(--surface-2); }
.stat-link { transition: transform .14s ease, border-color .14s ease; }
.stat-link:hover { transform: translateY(-2px); border-color: var(--brand); }
.stat-link:hover strong { color: var(--brand); }

/* ---------------------------------------------------------------- dashboard */
.welcome-panel {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 30px;
  padding: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(480px 300px at 95% 5%, rgba(182, 112, 64, .12), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow);
}
.welcome-copy h2 { margin-top: 12px; font-family: var(--font-serif); font-size: 34px; font-weight: 500; }
.welcome-copy > p { margin-top: 10px; color: var(--muted); max-width: 560px; }
.welcome-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.welcome-steps li { display: flex; gap: 13px; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.welcome-steps li:last-child { border-bottom: 0; padding-bottom: 0; }
.welcome-steps li > span { color: var(--accent); font-family: var(--font-serif); font-size: 20px; line-height: 1.2; }
.welcome-steps strong { display: block; font-size: 14px; }
.welcome-steps small { display: block; color: var(--muted); font-size: 12px; }
.site-list { display: flex; flex-direction: column; gap: 4px; }
.site-row { display: flex; gap: 14px; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--line); }
.site-row:last-child { border-bottom: 0; }
.site-avatar {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--site-color, var(--brand));
  color: #fffdf8;
  font-family: var(--font-serif);
  font-size: 21px;
}
.site-row-main { min-width: 0; flex: 1; }
.site-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-row-title h3 { font-size: 15.5px; }
.site-row-main > p { color: var(--muted); font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 5px; font-size: 11px; color: var(--faint); }
.site-row-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.ai-status { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 12px; }
.ai-status.is-ready { background: var(--ok-soft); border-color: #c3ddcd; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b0b4aa; margin-top: 5px; flex: 0 0 auto; }
.ai-status.is-ready .status-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 107, 79, .12); }
.ai-status strong { display: block; font-size: 13px; }
.ai-status small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 1px; }
.job-mini-list, .order-mini-list { display: flex; flex-direction: column; }
.job-mini, .order-mini { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.job-mini:last-child, .order-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.job-mini:hover, .order-mini:hover { color: var(--brand); }
.job-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.job-dot.job-running { background: #d7a64d; animation: pulse 1.6s infinite; }
.job-dot.job-done { background: var(--ok); }
.job-dot.job-error { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.job-mini-main { min-width: 0; flex: 1; }
.job-mini-main strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-mini-main small { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-mini-progress { color: var(--faint); font-size: 10.5px; font-family: var(--font-mono); }
.order-mini { justify-content: space-between; }
.order-mini strong { display: block; font-size: 12.5px; }
.order-mini small { display: block; color: var(--muted); font-size: 10.5px; }
.order-mini-amount { font-size: 12px; font-weight: 650; white-space: nowrap; }
.empty-note { color: var(--muted); font-size: 13px; padding: 8px 0; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: inherit; transition: border-color .15s, transform .15s, background .15s; }
.quick-card:hover { border-color: var(--brand); background: var(--surface); transform: translateY(-2px); color: inherit; }
.quick-icon { font-size: 20px; color: var(--accent); margin-bottom: 4px; }
.quick-card strong { font-size: 13.5px; }
.quick-card small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* ------------------------------------------------------------------- hero */
.hero-site {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
  gap: 24px;
  padding: 28px 30px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: #fffdf8;
  background:
    radial-gradient(500px 260px at 90% 0%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(140deg, var(--site-color, var(--brand)) 0%, #1b3328 100%);
  box-shadow: 0 16px 44px rgba(31, 50, 40, .18);
}
.hero-site h2 { color: #fffdf8; font-family: var(--font-serif); font-size: 30px; font-weight: 500; margin-top: 10px; }
.hero-site .badge { background: rgba(255, 253, 248, .16); color: #fffdf8; }
.hero-site .mono { color: rgba(255, 253, 248, .55); margin-top: 6px; font-size: 12px; }
.hero-site-side { display: flex; flex-direction: column; gap: 9px; align-self: center; border-left: 1px solid rgba(255, 253, 248, .16); padding-left: 24px; }
.hero-site-side div { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
.hero-site-side span { color: rgba(255, 253, 248, .55); }
.hero-site-side strong { font-weight: 600; text-align: right; }

/* ------------------------------------------------------------------ tables */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(248, 245, 237, .55); }
.data-table .small { font-size: 12px; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.wrap { word-break: break-word; }
.content-table .block-label { font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.content-table .block-value { font-size: 13px; color: var(--ink-2); max-width: 620px; }
.block-page-title { display: block; margin-top: 2px; }
.type-chip { display: inline-flex; padding: 3px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.type-price { background: var(--accent-soft); color: #8b4f28; border-color: #ecd4c0; }
.type-contact, .type-cta { background: var(--brand-soft); color: var(--brand); border-color: #cbdccc; }
.type-headline, .type-section_heading, .type-card_title { background: #eee9dd; color: #5b4d38; border-color: #e2d9c6; }
.type-image { background: #e8edf2; color: #3d5b70; border-color: #d4e0e8; }
.type-article_body, .type-paragraph { background: #f1efe9; }
.progress-inline { width: 110px; height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-inline span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 20px; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fffdf8; }
.page-gap { color: var(--faint); padding: 0 3px; }

/* ------------------------------------------------------------------ forms */
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.compact-stack { gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .14s, box-shadow .14s;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 93, 70, .12);
}
.field small, .hint { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.field-span-2 { grid-column: span 2; }
.field-grow { flex: 1; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 8px 0 0 8px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.input-prefix input { border-radius: 0 8px 8px 0; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.filter-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field-inline { min-width: 180px; }
.filter-actions { display: flex; gap: 6px; padding-bottom: 1px; }
.switch-row { display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; cursor: pointer; }
.switch-row > input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 36px; height: 21px; flex: 0 0 auto; margin-top: 2px; border-radius: 99px; background: #cbc9be; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fffdf8; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .15s; }
.switch-row input:checked + .switch-ui { background: var(--brand); }
.switch-row input:checked + .switch-ui::after { transform: translateX(15px); }
.switch-row strong { display: block; font-size: 13px; }
.switch-row small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 1px; }
.option-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 4px; }
.option-list .switch-row { border-bottom: 1px solid var(--line); padding: 13px 0; }
.option-list .switch-row:last-child { border-bottom: 0; }
.check-row { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check-row input { width: 15px; height: 15px; accent-color: var(--brand); }
.danger-check { color: var(--danger); }
.upload-row { display: flex; gap: 7px; align-items: stretch; }
.upload-row input[type="text"] { flex: 1; }
.upload-btn { flex: 0 0 auto; cursor: pointer; }
.image-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.image-preview img { width: 100%; max-height: 340px; object-fit: contain; }
.image-preview.is-empty { min-height: 120px; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.original-value { padding: 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); max-height: 210px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] { width: 46px; height: 38px; padding: 2px; }
.editor-toolbar { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--surface-2); }
.editor-toolbar button { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 4px 8px; font-size: 12px; color: var(--ink-2); }
.editor-toolbar button:hover { background: var(--surface); border-color: var(--line); }
.toolbar-hint { margin-left: auto; color: var(--faint); font-size: 10.5px; padding-right: 4px; }
.markdown-input { border-radius: 0 0 8px 8px !important; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; }
.tips-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12.5px; }
.tips-list li::marker { color: var(--accent); }
.simple-list { display: flex; flex-direction: column; }
.simple-row { display: flex; flex-direction: column; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; }
.simple-row:last-child { border-bottom: 0; }
.simple-row small { color: var(--muted); font-size: 11px; }
.simple-row:hover { color: var(--brand); }

/* ------------------------------------------------------------------ detail */
.detail-list { margin: 0; display: flex; flex-direction: column; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 11.5px; }
.detail-list dd { margin: 0; color: var(--ink-2); min-width: 0; }
.detail-list.compact > div { padding: 7px 0; }

/* ------------------------------------------------------------------- plans */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.plan-card.is-featured { border-color: #cbb892; background: linear-gradient(180deg, #fffaf0, var(--surface)); }
.plan-card.is-inactive { opacity: .68; }
.plan-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; }
.plan-key { color: var(--faint); font-size: 10.5px; }
.plan-card h2 { margin-top: 12px; font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.plan-subtitle { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.plan-price { font-family: var(--font-serif); font-size: 29px; color: var(--brand-dark); margin-top: 12px; }
.plan-meta { display: flex; gap: 8px; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.plan-meta span { padding: 2px 7px; background: var(--surface-2); border-radius: 5px; }
.plan-features { list-style: none; margin: 15px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.plan-features li { padding-left: 15px; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-size: 10px; top: 2px; }
.plan-linked { margin-top: auto; padding-top: 15px; }
.plan-actions { display: flex; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-actions form { margin: 0; }
.help-panel { margin-top: 18px; }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.help-grid > div { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 12.5px; }
.help-num { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; }

/* ---------------------------------------------------------------- articles */
.article-list { display: flex; flex-direction: column; }
.article-row { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.article-row:last-child { border-bottom: 0; }
.article-row-main { flex: 1; min-width: 0; }
.article-row-top { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; }
.article-row h3 { font-family: var(--font-serif); font-size: 19px; font-weight: 500; }
.article-row p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.meta-line { display: flex; gap: 12px; flex-wrap: wrap; color: var(--faint); font-size: 10.5px; margin-top: 8px; }
.article-row-actions { display: flex; flex-direction: column; gap: 5px; align-items: stretch; flex: 0 0 auto; }
.article-row-actions form { margin: 0; }
.article-row-actions .btn { justify-content: center; }

/* ----------------------------------------------------------------- payment */
.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.provider-card { position: relative; display: flex; gap: 11px; align-items: flex-start; padding: 15px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.provider-card input { position: absolute; opacity: 0; }
.provider-card:hover { border-color: var(--brand); }
.provider-card.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(47, 93, 70, .08); }
.provider-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--brand); font-weight: 700; }
.provider-card.is-selected .provider-icon { background: var(--brand); color: #fffdf8; }
.provider-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.provider-copy strong { font-size: 12.5px; }
.provider-copy small { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.provider-check { position: absolute; right: 10px; top: 10px; color: var(--brand); font-weight: 700; opacity: 0; font-size: 12px; }
.provider-card.is-selected .provider-check { opacity: 1; }
.provider-panel { margin-top: 22px; padding-top: 4px; }
.webhook-box { margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.webhook-box > span { display: block; font-size: 11px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.webhook-box small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.copy-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.copy-row code { flex: 1; min-width: 180px; padding: 7px 9px; word-break: break-all; background: var(--surface); }

/* ------------------------------------------------------------------ orders */
.filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab { padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-tab:hover { border-color: var(--brand); color: var(--brand); }
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: #fffdf8; }
.order-hero { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 24px 26px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.order-hero-ok { border-left: 4px solid var(--ok); }
.order-hero-warn { border-left: 4px solid #d7a64d; }
.order-hero-muted { border-left: 4px solid var(--faint); }
.order-hero h2 { font-family: var(--font-serif); font-size: 36px; font-weight: 500; margin-top: 8px; }
.order-hero p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.order-hero-meta { display: flex; gap: 28px; flex-wrap: wrap; align-self: center; }
.order-hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.order-hero-meta span { color: var(--faint); font-size: 10.5px; }
.order-hero-meta strong { font-size: 12.5px; font-weight: 600; }
.payload-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); padding: 11px 13px; }
.payload-box summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.payload-box pre { margin: 10px 0 0; font-size: 11px; line-height: 1.5; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-word; }
.payload-box ul { margin: 8px 0 0; padding-left: 18px; }

/* ----------------------------------------------------------------- imports */
.import-progress-panel { padding: 28px; }
.import-status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.import-status-head h2 { font-family: var(--font-serif); font-size: 27px; font-weight: 500; margin-top: 9px; }
.import-status-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.import-percent { display: flex; align-items: baseline; color: var(--brand); }
.import-percent strong { font-family: var(--font-serif); font-size: 48px; font-weight: 500; line-height: 1; }
.import-percent span { font-size: 16px; }
.progress { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-lg { height: 10px; margin: 24px 0 26px; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #6c9b7e); transition: width .5s ease; }
.import-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.import-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 9px; opacity: .6; }
.import-steps li.is-active { opacity: 1; border-color: #d7a64d; background: #fffaf0; }
.import-steps li.is-done { opacity: 1; border-color: #c3ddcd; background: var(--ok-soft); }
.import-step-dot { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 700; }
.import-steps li.is-active .import-step-dot { background: #d7a64d; color: #fff; }
.import-steps li.is-done .import-step-dot { background: var(--ok); color: #fff; }
.import-steps strong { display: block; font-size: 12px; }
.import-steps small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.4; margin-top: 1px; }
.import-result { display: flex; gap: 18px; align-items: flex-start; margin-top: 24px; padding: 20px; border-radius: 12px; background: var(--ok-soft); border: 1px solid #c3ddcd; }
.import-result .empty-icon { color: var(--ok); margin: 0; }
.import-result h3 { font-size: 18px; }
.import-result p { color: #3d6b52; font-size: 12.5px; margin-top: 3px; }
.import-result .button-row { margin-top: 12px; }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step-list li { display: flex; gap: 11px; align-items: flex-start; }
.step-list li > span { font-family: var(--font-serif); font-size: 15px; color: var(--accent); min-width: 24px; }
.step-list strong { display: block; font-size: 12.5px; }
.step-list small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 1px; }

/* ------------------------------------------------------------------- users */
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; gap: 13px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row-main { flex: 1; min-width: 0; }
.user-row-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-row-title h3 { font-size: 14px; }
.user-row-main > p { color: var(--muted); font-size: 12px; }
.user-row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.user-row-actions form { margin: 0; }
.inline-details { position: relative; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.popover-form { position: absolute; right: 0; top: calc(100% + 6px); width: 250px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; z-index: 20; }

/* ------------------------------------------------------------------- misc */
.empty-state { text-align: center; padding: 58px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 253, 248, .5); }
.empty-state.inline-empty { border: 0; border-radius: 0; padding: 46px 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 50px; height: 50px; margin-bottom: 13px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 20px; }
.empty-state h2 { font-family: var(--font-serif); font-size: 25px; font-weight: 500; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 7px auto 0; font-size: 13px; }
.empty-state .button-row { justify-content: center; }
.empty-state .btn { margin-top: 14px; }
.inline-status { font-size: 12px; color: var(--muted); }
.inline-status.ok { color: var(--ok); }
.inline-status.bad { color: var(--danger); }
.danger-panel { border-color: #eccbc5; }
.danger-panel .panel-head h2 { color: var(--danger); }
.simple-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.simple-card { width: min(560px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.simple-brand { justify-content: center; color: var(--ink); margin-bottom: 26px; }
.simple-brand .brand-text strong { color: var(--ink); }
.simple-brand .brand-text small { color: var(--muted); }
.simple-card h1 { font-size: 28px; margin-top: 4px; }
.simple-card p { color: var(--muted); margin-top: 8px; }
.error-code { font-family: var(--font-serif); font-size: 64px; line-height: 1; color: var(--accent); margin: 0; }
.simple-card .button-row { justify-content: center; }

/* -------------------------------------------------------------------- auth */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 80% 0%, rgba(182, 112, 64, .1), transparent 60%),
    var(--bg);
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(440px, 1.1fr); }
.auth-aside {
  position: relative;
  display: flex; flex-direction: column;
  padding: 34px 42px;
  color: rgba(255, 253, 248, .8);
  background:
    radial-gradient(600px 420px at 10% 0%, rgba(255, 255, 255, .1), transparent 60%),
    linear-gradient(150deg, #315f48, #1d382b 74%);
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute; right: -60px; bottom: -80px;
  width: 340px; height: 340px;
  border: 1px solid rgba(255, 253, 248, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(255, 253, 248, .025), 0 0 0 100px rgba(255, 253, 248, .018);
}
.auth-brand { color: #fffdf8; }
.auth-brand .brand-text strong { color: #fffdf8; }
.auth-brand .brand-text small { color: rgba(255, 253, 248, .55); }
.auth-quote { margin: auto 0; padding: 40px 0; position: relative; z-index: 1; }
.auth-quote .eyebrow { color: #d9b684; }
.auth-quote h1 { color: #fffdf8; font-size: clamp(38px, 4.2vw, 58px); font-weight: 400; line-height: 1.18; margin: 0; }
.auth-quote h1 span { color: #d9b684; font-style: italic; }
.auth-quote p { margin-top: 18px; max-width: 430px; color: rgba(255, 253, 248, .64); font-size: 14px; line-height: 1.75; }
.auth-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 9px; margin-bottom: 28px; }
.auth-features div { display: flex; align-items: center; gap: 11px; font-size: 12.5px; color: rgba(255, 253, 248, .68); }
.auth-features span { font-family: var(--font-serif); color: #d9b684; font-size: 13px; }
.auth-foot { color: rgba(255, 253, 248, .38); font-size: 10.5px; letter-spacing: .05em; position: relative; z-index: 1; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(440px, 100%); }
.auth-card h2 { font-family: var(--font-serif); font-size: 34px; font-weight: 500; }
.auth-lede { color: var(--muted); font-size: 13.5px; margin: 7px 0 22px; line-height: 1.6; }
.auth-card .notice { margin-bottom: 16px; }
.auth-card .notice ul { margin: 0; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-switch { margin-top: 20px; color: var(--muted); font-size: 12.5px; text-align: center; }
.auth-switch a { font-weight: 600; }
.auth-small { margin-top: 30px; color: var(--faint); font-size: 10.5px; text-align: center; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .stat-grid, .stat-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dashboard-grid, .edit-layout, .hero-site, .welcome-panel { grid-template-columns: minmax(0, 1fr); }
  .dashboard-side, .edit-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-site-side { border-left: 0; border-top: 1px solid rgba(255, 253, 248, .16); padding: 18px 0 0; }
  .import-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(20, 32, 25, .25); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { padding: 10px 20px; }
  .mobile-only { display: grid; }
  .page { padding: 24px 20px 60px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { justify-content: flex-start; padding-bottom: 0; }
  .mobile-scrim { display: none; position: fixed; inset: 0; background: rgba(20, 30, 24, .35); z-index: 35; }
  .mobile-scrim.is-open { display: block; }
  .dashboard-side, .edit-side { grid-template-columns: minmax(0, 1fr); }
  .provider-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-main { min-height: 100vh; }
  .user-meta { display: none; }
}
@media (max-width: 700px) {
  .stat-grid, .stat-grid-6, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field-span-2 { grid-column: auto; }
  .site-row { align-items: flex-start; flex-wrap: wrap; }
  .site-row-actions { width: 100%; padding-left: 60px; }
  .article-row { flex-direction: column; }
  .article-row-actions { flex-direction: row; flex-wrap: wrap; }
  .import-steps { grid-template-columns: minmax(0, 1fr); }
  .order-hero-meta { gap: 16px; }
  .import-status-head h2 { font-size: 22px; }
  .import-percent strong { font-size: 36px; }
  .page-head h1 { font-size: 32px; }
  .topbar-actions > .btn-ghost { display: none; }
}
@media (max-width: 480px) {
  .stat-grid, .stat-grid-6, .stat-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 20px 14px 50px; }
  .panel { padding: 17px; }
  .import-progress-panel { padding: 18px; }
}

/* Toasts (admin.js) */
.admin-toast-host { position: fixed; right: 18px; top: 18px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.admin-toast { padding: 10px 14px; border-radius: 9px; background: rgba(23, 37, 30, .96); color: #fffdf6; font-size: 12px; line-height: 1.5; letter-spacing: .01em; box-shadow: 0 14px 36px rgba(14, 24, 18, .28); opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }
.admin-toast.is-visible { opacity: 1; transform: translateY(0); }
.admin-toast.is-bad { background: #8a3c32; }
@media (max-width: 700px) {
  .admin-toast-host { left: 14px; right: 14px; top: 12px; }
  /* Brand lockup must not overflow the topbar/sidebar on small screens */
  .brand { min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text strong { white-space: nowrap; }
  .brand-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-title { min-width: 0; flex: 1 1 auto; }
  .topbar-current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Prevent horizontal scroll from wide pills, tables, code and grids */
  .page, .panel { overflow-x: clip; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .copy-row code { min-width: 0; }
  .filter-tabs { flex-wrap: wrap; }
}

/* ------------------------------------------------- typography refresh
   提升繁體中文閱讀舒適度：放大字級、放寬行距與字距，避免擠成黑黑一團 */
body {
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .012em;
}
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: .01em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
small { font-size: 13px; line-height: 1.6; }
p { line-height: 1.8; }
.eyebrow { font-size: 11.5px; }
.page-sub { font-size: 14.5px; line-height: 1.75; }
.topbar-crumb { font-size: 11px; }
.topbar-current { font-size: 14.5px; }
.brand-text strong { font-size: 18px; }
.brand-text small { font-size: 12px; }
.side-label { font-size: 11.5px; }
.side-link { font-size: 14.5px; }
.side-icon { font-size: 15px; }
.side-site strong { font-size: 13.5px; }
.side-site small { font-size: 11.5px; }
.sidebar-note p { font-size: 12px; line-height: 1.6; }
.btn { font-size: 14px; }
.btn-sm { font-size: 13px; }
.badge { font-size: 11.5px; }
.data-table { font-size: 14px; line-height: 1.65; }
.data-table th { font-size: 11.5px; }
.cell-sub { font-size: 12px; }
.type-chip { font-size: 11px; }
.panel-head p { font-size: 13px; }
.stat-label { font-size: 12px; }
.stat-card small { font-size: 11px; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11px; }
.user-pop a, .user-pop button { font-size: 13.5px; }
.field > span { font-size: 13px; }
.field input, .field select, .field textarea { font-size: 14.5px; }
.field small, .hint { font-size: 12.5px; line-height: 1.7; }
.form-errors, .flash, .notice { font-size: 14px; line-height: 1.7; }
.empty-state h2 { font-size: 26px; }
.empty-state p { font-size: 13.5px; line-height: 1.75; }
.tips-list { font-size: 13.5px; line-height: 1.7; }
.step-list strong { font-size: 13px; }
.step-list small { font-size: 11.5px; }
.import-steps strong { font-size: 12.5px; }
.import-steps small { font-size: 11px; }
.detail-list > div { font-size: 13.5px; line-height: 1.7; }
.simple-row { font-size: 13px; }
.simple-row small { font-size: 11.5px; }
.filter-tab { font-size: 12.5px; }
.page-btn { font-size: 12.5px; }
.inline-status { font-size: 12.5px; }
.text-link { font-size: 13.5px; }
.mono, code { letter-spacing: 0; }
.auth-lede { font-size: 14px; line-height: 1.75; }
.auth-features div { font-size: 13px; }
.auth-small { font-size: 11px; }
.welcome-steps strong { font-size: 14.5px; }
.welcome-steps small { font-size: 12.5px; line-height: 1.6; }
.quick-card strong { font-size: 14px; }
.quick-card small { font-size: 12px; line-height: 1.55; }
