:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #16211f;
  --muted: #667775;
  --line: #dbe5e2;
  --brand: #167464;
  --brand-dark: #0f5e51;
  --brand-soft: #e5f3ef;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(16, 39, 35, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(22, 116, 100, .16), transparent 34%),
    linear-gradient(180deg, #fbfdfc 0%, var(--bg) 36%);
}
.site-header {
  margin-left: 220px;
  padding: 28px 32px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}
.brand-rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: #102722;
  color: #fff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brand-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.brand-rail span { display: block; margin-top: 4px; color: #a9c5bf; font-size: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #25a58e, #d7b46a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand-mark.large { width: 58px; height: 58px; border-radius: 16px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 19px; }
.page-subtitle, .section-head p, .hint, .muted { color: var(--muted); }
.muted { display: block; margin-top: 4px; font-size: 12px; }
main { padding: 0 32px 36px; max-width: 1380px; margin: 0 0 0 220px; }
.side-nav { display: grid; gap: 8px; margin-top: 8px; }
.side-nav a, .side-nav button {
  width: 100%;
  justify-content: flex-start;
  background: rgba(255,255,255,.06);
  color: #e7f2ef;
  border-color: rgba(255,255,255,.12);
}
.side-nav form { margin: 0; }
.side-nav a:hover, .side-nav button:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.24);
  transform: translateX(2px);
}
.button, button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: .16s ease;
}
.button:hover, button:hover { border-color: #9bb4ae; transform: translateY(-1px); }
.actions form { display: inline; margin: 0; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.primary-soft { background: var(--brand-soft); border-color: #b7d9d0; color: var(--brand-dark); }
.ghost { background: transparent; color: #d9e7e4; border-color: rgba(255,255,255,.18); }
.danger { color: var(--danger); }
.panel, .search-panel {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title span {
  color: var(--muted);
  background: #f0f5f3;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.section-head { margin: 10px 0 14px; }
.form-panel { max-width: 980px; }
.narrow { max-width: 460px; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; margin-bottom: 14px; font-weight: 700; color: #253330; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd9d6;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(22, 116, 100, .1);
}
textarea { min-height: 88px; resize: vertical; }
table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
th, td { border-bottom: 1px solid #e7eeec; padding: 13px 12px; text-align: left; vertical-align: middle; }
th { background: #f7faf9; color: #52645f; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.id-pill, .status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}
.id-pill { background: #eef4f2; color: #34524b; }
.ok-badge { background: #e7f8ef; color: #116329; }
.off-badge { background: #f2f3f3; color: #697471; }
.error { color: var(--danger); background: #fff0ed; padding: 10px 12px; border-radius: 10px; }
.ok { color: #116329; background: #eefbf1; padding: 10px 12px; border-radius: 10px; }
.search-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}
.search-panel label { margin: 0; }
.page-actions {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}
.compact-search { margin-bottom: 0; box-shadow: none; }
.page-action-button { padding: 14px 18px; white-space: nowrap; }
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 18%, rgba(215, 180, 106, .24), transparent 28%),
    radial-gradient(circle at 78% 20%, rgba(22, 116, 100, .22), transparent 32%),
    linear-gradient(135deg, #102722, #f4f7f6 58%);
}
.login-page .site-header { display: none; }
.login-page main { margin: 0; max-width: none; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(0,0,0,.22);
  overflow: hidden;
}
.login-copy {
  padding: 44px;
  background: linear-gradient(145deg, rgba(16,39,34,.96), rgba(19,86,76,.92));
  color: #fff;
}
.login-copy h2 { font-size: 32px; line-height: 1.24; margin: 16px 0; }
.login-copy p { color: #c7ddd8; line-height: 1.7; }
.eyebrow { text-transform: uppercase; font-size: 12px; letter-spacing: .12em; }
.login-card { padding: 44px; background: #fff; }
.login-card h2 { font-size: 24px; }
.wide { width: 100%; padding: 13px 16px; }
.copy-page, .promo { max-width: 680px; margin: 36px auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.copy-page input { margin: 14px 0; }
.promo img { width: 100%; height: auto; border-radius: 12px; }
@media (max-width: 960px) {
  .brand-rail { position: static; width: auto; }
  .site-header, main { margin-left: 0; }
  .site-header { align-items: flex-start; flex-direction: column; padding: 22px 18px; }
  main { padding: 0 18px 24px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-copy, .login-card { padding: 28px; }
  .search-panel { grid-template-columns: 1fr; }
  .page-actions { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}
