:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --paper-deep: #e9ddc8;
  --ink: #18231e;
  --muted: #66736a;
  --line: rgba(87, 68, 39, .16);
  --line-strong: rgba(130, 95, 44, .32);
  --surface: rgba(255, 252, 244, .88);
  --surface-solid: #fffaf0;
  --dark: #0b1411;
  --dark-2: #14241f;
  --tea: #8a5a24;
  --tea-soft: #efe1c4;
  --gold: #d8ad61;
  --silver: #dfe9e7;
  --jade: #2f705e;
  --jade-soft: #dcebe2;
  --cinnabar: #a9493c;
  --cinnabar-soft: #f1ddd7;
  --blue: #486d82;
  --shadow: 0 18px 46px rgba(47, 38, 24, .12), 0 2px 0 rgba(255, 255, 255, .34) inset;
  --shadow-deep: 0 28px 80px rgba(17, 24, 18, .18);
  --radius: 8px;
  --sidebar: 244px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(47, 112, 94, .045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(138, 90, 36, .052) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 252, 244, .72), rgba(233, 221, 200, .36)),
    var(--paper);
  background-size: 42px 42px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(108deg, transparent 0 84px, rgba(138, 90, 36, .035) 85px 86px, transparent 87px 148px),
    linear-gradient(120deg, transparent 0 62%, rgba(47, 112, 94, .045) 62.3% 62.7%, transparent 63%),
    linear-gradient(180deg, rgba(255, 252, 244, .52), transparent 42%, rgba(11, 20, 17, .025));
  opacity: .82;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#ambientCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: .18;
}

#app {
  position: relative;
  z-index: 1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.login-page {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 46px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(138, 90, 36, .18), transparent 28%),
    radial-gradient(circle at 20% 78%, rgba(47, 112, 94, .13), transparent 32%);
}

.login-shell {
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .72fr);
  gap: 18px;
  align-items: stretch;
}

.login-hero,
.login-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-hero {
  padding: clamp(26px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(220, 235, 226, .82), transparent 58%),
    linear-gradient(180deg, rgba(255, 252, 244, .94), rgba(247, 242, 232, .9)),
    var(--surface-solid);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(138, 90, 36, .13);
  border-radius: 7px;
  pointer-events: none;
}

.login-hero::after {
  content: "一茶一卦";
  position: absolute;
  right: clamp(20px, 4vw, 46px);
  bottom: clamp(18px, 4vw, 42px);
  color: rgba(138, 90, 36, .16);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(48px, 8vw, 118px);
  writing-mode: vertical-rl;
  letter-spacing: 0;
}

.login-brand {
  position: absolute;
  left: clamp(24px, 4vw, 42px);
  top: clamp(22px, 4vw, 36px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.login-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin-top: 72px;
  font-size: clamp(46px, 7.2vw, 86px);
  color: #173028;
}

.login-hero .lead,
.login-hero .eyebrow,
.login-rhythm {
  position: relative;
  z-index: 1;
}

.login-hero .lead {
  max-width: 690px;
  font-size: 18px;
}

.login-rhythm {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.login-rhythm span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(47, 112, 94, .18);
  border-radius: 999px;
  background: rgba(255, 252, 244, .62);
  color: var(--jade);
  font-size: 13px;
  font-weight: 800;
}

.login-card {
  padding: clamp(22px, 4vw, 34px);
  display: grid;
  align-content: center;
  background:
    linear-gradient(180deg, rgba(20, 36, 31, .95), rgba(7, 14, 12, .98)),
    var(--dark);
  color: #fff4df;
}

.login-card p {
  color: rgba(255, 244, 223, .68);
  line-height: 1.75;
}

.login-card .field {
  margin-top: 8px;
  color: rgba(255, 244, 223, .78);
}

.login-card .field input {
  border-color: rgba(236, 198, 128, .28);
  background: rgba(255, 255, 255, .08);
  color: #fff4df;
}

.login-card .ghost-button {
  border-color: rgba(236, 198, 128, .28);
  background: rgba(255, 255, 255, .06);
  color: #fff4df;
}

.login-card .button {
  background: linear-gradient(135deg, #fff1cd, #b98235);
  color: #17231e;
  border-color: rgba(236, 198, 128, .45);
}

.login-orbit {
  height: 238px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.tea-plate {
  position: relative;
  width: 238px;
  height: 238px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(236, 198, 128, .28);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(236, 198, 128, .18), transparent 56%),
    rgba(255, 255, 255, .035);
}

.tea-plate::before,
.tea-plate::after {
  content: "";
  position: absolute;
  inset: 46px;
  border: 1px solid rgba(236, 198, 128, .28);
  border-radius: 50%;
}

.tea-plate::after {
  inset: 86px;
  background: radial-gradient(circle, rgba(244, 214, 154, .18), transparent 68%);
}

.tea-plate span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 198, 128, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 244, 223, .72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
}

.tea-plate span:nth-child(5) {
  background: linear-gradient(135deg, rgba(236, 198, 128, .96), rgba(138, 90, 36, .9));
  color: #14241f;
  font-weight: 900;
}

.login-note {
  margin-top: 22px;
  padding: 13px;
  border: 1px solid rgba(236, 198, 128, .18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
}

.login-note strong,
.login-note span {
  display: block;
}

.login-note strong {
  margin-bottom: 6px;
  color: #f1d49e;
}

.login-note span {
  color: rgba(255, 244, 223, .66);
  font-size: 13px;
  line-height: 1.7;
}

body.login-mode {
  overflow: hidden;
  background: #030606;
  color: #fff4df;
}

body.login-mode::before {
  display: none;
}

body.login-mode #ambientCanvas {
  z-index: 0;
  opacity: 1;
}

body.login-mode #app {
  min-height: 100vh;
}

body.login-mode .login-page {
  min-height: 100vh;
  padding: clamp(22px, 4vw, 48px) clamp(18px, 2.4vw, 36px) clamp(22px, 4vw, 48px) clamp(28px, 5vw, 88px);
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 430px);
  align-items: center;
  gap: clamp(48px, 8vw, 168px);
  background:
    linear-gradient(90deg, rgba(3, 6, 6, .64) 0%, rgba(3, 6, 6, .50) 34%, rgba(3, 6, 6, .82) 67%, rgba(3, 6, 6, .94) 100%),
    radial-gradient(circle at 34% 49%, rgba(236, 198, 128, .15), transparent 32%);
}

.login-copy {
  position: relative;
  z-index: 2;
  max-width: 500px;
  padding-left: clamp(0px, 1.6vw, 24px);
}

.login-copy .login-brand {
  position: static;
  margin-bottom: clamp(34px, 6vh, 62px);
  color: #fff3df;
}

.login-tree {
  position: absolute;
  right: clamp(-22px, -1vw, 10px);
  top: clamp(112px, 21vh, 188px);
  z-index: 1;
  width: clamp(170px, 16vw, 250px);
  height: auto;
  overflow: visible;
  pointer-events: none;
  opacity: .48;
  filter: drop-shadow(0 0 24px rgba(216, 173, 97, .12));
}

.login-tree path,
.login-tree circle {
  vector-effect: non-scaling-stroke;
}

.login-tree .tree-trunk,
.login-tree .tree-branch {
  fill: none;
  stroke: rgba(223, 233, 231, .44);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-tree .tree-trunk {
  stroke-width: 3.4;
}

.login-tree .tree-branch {
  stroke-width: 2.1;
}

.login-tree .tree-leaf {
  fill: rgba(47, 112, 94, .13);
  stroke: rgba(216, 173, 97, .32);
  stroke-width: 1.2;
}

.login-tree circle {
  fill: rgba(216, 173, 97, .58);
}

.login-copy .login-brand,
.login-copy .eyebrow,
.login-copy h1,
.login-copy .lead,
.login-copy .login-rhythm {
  position: relative;
  z-index: 2;
}

.login-copy .login-brand span {
  color: rgba(255, 244, 223, .62);
}

.login-copy h1 {
  max-width: 430px;
  margin-bottom: 14px;
  color: #fff3df;
  font-size: clamp(28px, 2.75vw, 42px);
  line-height: 1.16;
  text-shadow: 0 0 24px rgba(236, 198, 128, .14);
}

.login-copy .lead {
  max-width: 420px;
  color: rgba(255, 244, 223, .72);
  font-size: 14px;
}

.login-copy .eyebrow,
.login-panel .eyebrow {
  color: #d8ad61;
}

.login-copy .login-rhythm span {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(236, 198, 128, .22);
  background: rgba(255, 244, 223, .07);
  color: rgba(255, 244, 223, .78);
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.login-panel {
  position: relative;
  z-index: 3;
  width: min(430px, 100%);
  justify-self: end;
  margin-right: clamp(0px, 1vw, 18px);
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(236, 198, 128, .24);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(18, 32, 27, .78), rgba(4, 8, 7, .86)),
    rgba(8, 14, 12, .72);
  color: #fff4df;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42);
  backdrop-filter: blur(18px);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(236, 198, 128, .1);
  border-radius: 7px;
  pointer-events: none;
}

.login-panel h2 {
  color: #fff3df;
}

.login-panel p {
  color: rgba(255, 244, 223, .68);
  line-height: 1.75;
}

.login-panel .field {
  color: rgba(255, 244, 223, .78);
}

.login-panel .field input {
  border-color: rgba(236, 198, 128, .28);
  background: rgba(255, 255, 255, .07);
  color: #fff4df;
}

.login-panel .button {
  background: linear-gradient(135deg, #fff1cd, #b98235);
  color: #17231e;
  border-color: rgba(236, 198, 128, .48);
}

.login-panel .ghost-button {
  border-color: rgba(236, 198, 128, .28);
  background: rgba(255, 255, 255, .06);
  color: #fff4df;
}

.login-panel .lock-error {
  color: #f0a99c;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #f6ead6;
  background:
    repeating-linear-gradient(90deg, rgba(255, 246, 226, .025) 0 1px, transparent 1px 32px),
    linear-gradient(180deg, rgba(22, 36, 31, .98), rgba(8, 14, 12, .985)),
    var(--dark);
  border-right: 1px solid rgba(225, 193, 133, .18);
  box-shadow: 14px 0 38px rgba(13, 20, 16, .12);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 198, 128, .48);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .42), transparent 26%),
    linear-gradient(135deg, #d7b06a, #3c7a65 58%, #101a16);
  color: #fff6e4;
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.1), 0 10px 24px rgba(0,0,0,.24), 0 0 0 5px rgba(236, 198, 128, .08);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.2;
}

.brand span {
  margin-top: 3px;
  color: rgba(246, 234, 214, .68);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button,
.sidebar-action {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(246, 234, 214, .72);
  text-align: left;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.nav button:hover,
.nav button.active,
.sidebar-action:hover {
  border-color: rgba(236, 198, 128, .24);
  background:
    linear-gradient(90deg, rgba(216, 173, 97, .16), rgba(255, 246, 226, .055)),
    rgba(255, 246, 226, .06);
  color: #fff3dc;
  transform: translateX(2px);
}

.nav button.active {
  box-shadow: inset 3px 0 0 rgba(216, 173, 97, .82);
}

.side-note {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(236, 198, 128, .2);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 246, 226, .08), rgba(63, 122, 100, .08)),
    rgba(255, 246, 226, .045);
}

.side-note strong {
  display: block;
  margin-bottom: 7px;
  color: #f3d8a2;
}

.side-note p {
  margin: 0;
  color: rgba(246, 234, 214, .68);
  font-size: 13px;
  line-height: 1.7;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 68px;
  padding: 12px clamp(16px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 252, 244, .9), rgba(247, 242, 232, .72)),
    rgba(247, 242, 232, .83);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 8px 24px rgba(47, 38, 24, .055);
}

.mobile-menu {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mobile-menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.search {
  flex: 1;
  min-width: 180px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .9), rgba(255, 248, 235, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.search span {
  color: var(--tea);
  font-size: 20px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.user-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .95), rgba(239, 225, 196, .56));
  color: var(--ink);
}

.content {
  padding: 30px clamp(16px, 3vw, 34px) 58px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(87, 68, 39, .1);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--tea);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(31px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.18;
}

h3 {
  margin-bottom: 9px;
  font-size: 19px;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.metric,
.table-panel,
.daily-card,
.drawer,
.admin-lock {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .95), rgba(255, 248, 235, .84)),
    var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.table-panel,
.daily-card,
.admin-lock {
  padding: 18px;
}

.hero-board {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .72fr);
  gap: 14px;
  margin-bottom: 16px;
}

.hero-card {
  position: relative;
  min-height: 270px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(236, 198, 128, .22);
  border-radius: var(--radius);
  color: #fff5df;
  background:
    repeating-linear-gradient(110deg, rgba(255, 244, 223, .025) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, rgba(18, 34, 28, .96), rgba(8, 13, 11, .98)),
    #101a16;
  box-shadow: var(--shadow-deep);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  right: -120px;
  top: -150px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(216, 173, 97, .16);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(216, 173, 97, .03),
    0 0 0 72px rgba(223, 233, 231, .025),
    inset 0 0 72px rgba(216, 173, 97, .08);
}

.hero-card::after {
  content: "茶席";
  position: absolute;
  right: 34px;
  bottom: 22px;
  color: rgba(255, 244, 223, .09);
  font-family: "Songti SC", "STSong", serif;
  font-size: 86px;
  line-height: 1;
  writing-mode: vertical-rl;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-seal {
  position: absolute;
  right: clamp(22px, 3vw, 42px);
  top: clamp(20px, 3vw, 34px);
  z-index: 0;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 173, 97, .34);
  color: rgba(255, 244, 223, .72);
  font-family: "Songti SC", "STSong", serif;
  font-size: 32px;
  background: rgba(255, 244, 223, .045);
}

.tea-path {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 590px;
}

.tea-path span {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(216, 173, 97, .2);
  border-radius: var(--radius);
  background: rgba(255, 244, 223, .055);
  color: rgba(255, 245, 223, .82);
}

.tea-path b {
  color: rgba(216, 173, 97, .9);
  font-size: 11px;
}

.hero-card .lead {
  color: rgba(255, 245, 223, .72);
}

.hero-card .eyebrow {
  color: var(--gold);
}

.hero-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button,
.ghost-button,
.danger-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.button {
  background:
    linear-gradient(135deg, rgba(255, 236, 190, .96), rgba(182, 125, 50, .96));
  border-color: rgba(138, 90, 36, .36);
  color: #17231e;
  box-shadow: 0 10px 24px rgba(138, 90, 36, .16), inset 0 1px 0 rgba(255, 255, 255, .48);
}

.button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.button:active,
.ghost-button:active,
.danger-button:active {
  transform: translateY(0);
}

.hero-card .button,
.daily-card .button,
.login-panel .button {
  background: linear-gradient(135deg, #fff1cd, #b98235);
  color: #17231e;
}

.hero-card .ghost-button {
  border-color: rgba(216, 173, 97, .26);
  background: rgba(255, 244, 223, .07);
  color: #fff4df;
  backdrop-filter: blur(8px);
}

.ghost-button {
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .88), rgba(239, 225, 196, .52));
  color: var(--ink);
}

.danger-button {
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  border-color: rgba(169, 73, 60, .22);
}

.metric {
  position: relative;
  padding: 16px;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(47, 112, 94, .78), rgba(216, 173, 97, .72), transparent);
}

.metric i {
  position: absolute;
  right: 13px;
  top: 13px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(138, 90, 36, .12);
  transform: rotate(45deg);
  opacity: .7;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 9px;
  color: #13251f;
  font-size: 30px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--tea);
}

.metric-button {
  width: 100%;
  min-height: 118px;
  text-align: left;
}

.metric-button:hover,
.metric-button:focus-visible,
.metric-button.is-active {
  border-color: rgba(47, 112, 94, .36);
  background:
    linear-gradient(180deg, rgba(220, 235, 226, .94), rgba(255, 252, 244, .9));
  box-shadow: 0 14px 32px rgba(47, 112, 94, .13), inset 0 1px 0 rgba(255, 255, 255, .66);
  outline: 0;
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(87, 68, 39, .1);
  border-radius: var(--radius);
  background: rgba(255, 252, 244, .58);
}

.toolbar select,
.toolbar input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(255, 248, 235, .82));
  color: var(--ink);
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar select:focus,
.toolbar input:focus,
.search:focus-within {
  border-color: rgba(47, 112, 94, .46);
  box-shadow: 0 0 0 3px rgba(47, 112, 94, .11), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.toolbar select,
.toolbar input {
  width: auto;
  padding: 0 11px;
}

.import-panel {
  margin-bottom: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(47, 112, 94, .16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(220, 235, 226, .78), rgba(255, 252, 244, .9)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(47, 38, 24, .08);
  position: relative;
  overflow: hidden;
}

.import-panel::after {
  content: "";
  position: absolute;
  inset: auto 22px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 112, 94, .26), transparent);
}

.import-panel h2,
.import-panel p {
  margin: 0;
}

.import-panel h2 {
  font-size: 20px;
}

.import-panel p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.import-actions {
  min-width: 230px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.import-status {
  max-width: 280px;
  color: var(--tea);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  padding: 0 11px;
}

.field textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.65;
}

.quick-panel {
  border-color: rgba(47, 112, 94, .16);
  background:
    linear-gradient(135deg, rgba(220, 235, 226, .66), rgba(255, 252, 244, .92)),
    var(--surface);
}

.quick-form {
  display: grid;
  gap: 10px;
  align-items: end;
}

.tea-form {
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) 92px minmax(180px, 1fr) auto;
}

.course-form {
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(150px, .8fr) minmax(220px, 1.15fr) auto;
}

.quick-submit {
  align-self: end;
  min-width: 104px;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 14px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
}

.customer-table-panel {
  padding: 0;
  overflow: hidden;
}

.customer-table-scroll {
  max-height: calc(100vh - 286px);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

th {
  color: var(--muted);
  font-size: 12px;
  background:
    linear-gradient(180deg, rgba(233, 221, 200, .76), rgba(220, 235, 226, .32));
  position: sticky;
  top: 0;
  z-index: 4;
}

td select,
td input[type="date"] {
  width: 100%;
  min-width: 132px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(255, 248, 235, .82));
  color: var(--ink);
  outline: 0;
}

td select:focus,
td input[type="date"]:focus {
  border-color: rgba(47, 112, 94, .46);
  box-shadow: 0 0 0 3px rgba(47, 112, 94, .11);
}

tr:last-child td {
  border-bottom: 0;
}

tr.is-selected {
  background:
    linear-gradient(90deg, rgba(220, 235, 226, .9), rgba(255, 252, 244, .78));
}

.customer-table tbody tr {
  cursor: pointer;
  outline: 0;
}

.customer-table tbody tr:hover,
.customer-table tbody tr:focus-visible {
  background:
    linear-gradient(90deg, rgba(220, 235, 226, .66), rgba(255, 252, 244, .86));
}

.customer-table th:first-child,
.customer-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 160px;
  background: rgba(255, 252, 244, .96);
  box-shadow: 1px 0 0 var(--line);
}

.customer-table th:first-child {
  z-index: 5;
  background: rgba(233, 221, 200, .98);
}

.customer-table tr.is-selected td:first-child {
  background: #dcebe2;
}

.row-button {
  border: 0;
  background: transparent;
  color: var(--jade);
  font-weight: 800;
  text-align: left;
  pointer-events: none;
  font-size: 16px;
}

.row-button[data-open-customer] {
  cursor: pointer;
  pointer-events: auto;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(138, 90, 36, .08);
  background:
    linear-gradient(180deg, rgba(239, 225, 196, .98), rgba(225, 202, 158, .72));
  color: #7d5520;
  font-size: 12px;
  font-weight: 800;
}

.status {
  background:
    linear-gradient(180deg, rgba(220, 235, 226, .98), rgba(188, 218, 205, .72));
  color: var(--jade);
}

.status.warm {
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.drawer {
  position: sticky;
  top: 86px;
  padding: 16px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  border-color: rgba(47, 112, 94, .18);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .98), rgba(247, 242, 232, .9));
}

.drawer::before {
  content: "";
  display: block;
  height: 4px;
  margin: -16px -16px 14px;
  background: linear-gradient(90deg, var(--jade), var(--gold), rgba(223, 233, 231, .72));
}

.drawer-empty {
  color: var(--muted);
  line-height: 1.7;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(216, 173, 97, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(18, 36, 30, .97), rgba(8, 14, 12, .95));
  color: #fff4df;
}

.detail-title h3 {
  color: #fff4df;
}

.detail-title .eyebrow {
  color: rgba(216, 173, 97, .9);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detail-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(87, 68, 39, .12);
}

.detail-item b,
.detail-item span {
  display: block;
}

.detail-item b {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail-item span {
  color: var(--ink);
  line-height: 1.65;
}

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

.advisor-card {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .94), rgba(220, 235, 226, .42)),
    var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  outline: 0;
}

.advisor-card:hover,
.advisor-card:focus-visible,
.advisor-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(47, 112, 94, .32);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(220, 235, 226, .68)),
    var(--surface);
  box-shadow: 0 20px 48px rgba(47, 38, 24, .13), inset 0 1px 0 rgba(255, 255, 255, .62);
}

.advisor-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 16px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(47, 112, 94, .14);
  transform: rotate(45deg);
  opacity: .7;
}

.advisor-card.is-active::after {
  border-color: rgba(216, 173, 97, .44);
  opacity: 1;
}

.advisor-focus-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.advisor-focus-actions span {
  color: var(--tea);
  font-size: 13px;
  font-weight: 800;
}

.advisor-detail-panel {
  scroll-margin-top: 86px;
  outline: 0;
}

.advisor-detail-panel:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 112, 94, .13), var(--shadow);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102, 115, 106, .14);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), var(--tea));
}

.product-card {
  position: relative;
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(239, 225, 196, .36)),
    var(--surface);
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(216, 173, 97, .75), rgba(47, 112, 94, .55), transparent);
}

.product-card strong {
  display: block;
  font-size: 18px;
}

.product-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.price {
  margin-top: 10px;
  color: var(--tea);
  font-size: 22px;
  font-weight: 900;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.catalog-board {
  display: grid;
  gap: 16px;
}

.catalog-group {
  overflow: hidden;
  border: 1px solid rgba(130, 95, 44, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .78), rgba(247, 242, 232, .58));
}

.catalog-group-head {
  min-height: 56px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(130, 95, 44, .14);
  background:
    linear-gradient(90deg, rgba(47, 112, 94, .10), rgba(216, 173, 97, .10), transparent);
}

.catalog-group-head h3 {
  margin: 0;
  color: var(--jade);
  font-size: 18px;
}

.catalog-group-head span {
  min-width: 46px;
  padding: 5px 9px;
  border: 1px solid rgba(47, 112, 94, .18);
  border-radius: 999px;
  color: var(--tea);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.catalog-table table {
  min-width: 780px;
}

.catalog-table td:first-child,
.catalog-table th:first-child {
  width: 142px;
}

.catalog-table td:nth-child(3),
.catalog-table th:nth-child(3) {
  width: 112px;
}

.catalog-table td:nth-child(4),
.catalog-table th:nth-child(4) {
  width: 104px;
}

.catalog-price {
  color: var(--tea);
  font-size: 17px;
}

.catalog-price.pending {
  color: var(--cinnabar);
}

.product-rule {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(102, 115, 106, .18);
  border-radius: 999px;
  background: rgba(102, 115, 106, .08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.product-rule.gift {
  border-color: rgba(47, 112, 94, .20);
  background: rgba(47, 112, 94, .10);
  color: var(--jade);
}

.product-rule.pending {
  border-color: rgba(169, 73, 60, .22);
  background: rgba(169, 73, 60, .08);
  color: var(--cinnabar);
}

.upgrade-result {
  min-height: 80px;
  padding: 14px;
  border: 1px solid rgba(47, 112, 94, .22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(220, 235, 226, .96), rgba(255, 252, 244, .82));
  color: var(--ink);
  line-height: 1.7;
}

.upgrade-result b {
  color: var(--jade);
  font-size: 24px;
}

.material-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
}

.material-strip img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-deep);
}

.daily-card {
  display: grid;
  gap: 12px;
  align-content: start;
  color: #fff4df;
  border-color: rgba(216, 173, 97, .25);
  background:
    repeating-linear-gradient(110deg, rgba(255, 244, 223, .026) 0 1px, transparent 1px 38px),
    linear-gradient(160deg, rgba(18, 34, 28, .98), rgba(8, 13, 11, .96));
  box-shadow: var(--shadow-deep);
}

.daily-card-head h3 {
  color: #fff4df;
}

.daily-card .eyebrow {
  color: var(--gold);
}

.daily-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(236, 198, 128, .22);
  border-radius: var(--radius);
  background: #101a16;
}

.daily-card p {
  margin: 0;
  color: rgba(255, 244, 223, .68);
  line-height: 1.75;
}

.daily-card .ghost-button {
  border-color: rgba(216, 173, 97, .28);
  background: rgba(255, 255, 255, .06);
  color: #fff4df;
}

.daily-actions {
  margin-top: 4px;
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminder {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .88), rgba(247, 242, 232, .68));
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.reminder:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 112, 94, .26);
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(220, 235, 226, .48));
}

.reminder strong {
  display: block;
  margin-bottom: 4px;
}

.reminder span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr);
  gap: 14px;
}

.finance-import-actions {
  min-width: 280px;
}

.ledger-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.money-positive {
  color: var(--jade);
}

.money-negative {
  color: var(--cinnabar);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
}

tr[data-open-customer] {
  cursor: pointer;
  outline: 0;
}

tr[data-open-customer]:hover,
tr[data-open-customer]:focus-visible {
  background:
    linear-gradient(90deg, rgba(220, 235, 226, .66), rgba(255, 252, 244, .86));
}

.chart {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 66px 1fr 90px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(102,115,106,.13);
  box-shadow: inset 0 0 0 1px rgba(87, 68, 39, .06);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f705e, #b98335);
}

.bar-row.negative .bar span {
  background: linear-gradient(90deg, #a9493c, #d19770);
}

.admin-lock {
  max-width: 520px;
  margin: 40px auto;
  display: grid;
  gap: 12px;
}

.lock-error {
  min-height: 20px;
  color: var(--cinnabar);
  font-weight: 800;
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(169, 73, 60, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(241, 221, 215, .92), rgba(255, 252, 244, .72));
  color: #7a2f28;
  line-height: 1.7;
}

.admin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, .96), rgba(241, 221, 215, .58)),
    var(--surface);
}

.admin-tools h2,
.admin-tools p {
  margin: 0;
}

.admin-tools p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-reset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 460px;
  }

  .grid.four,
  .product-stats,
  .material-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-layout,
  .hero-board,
  .finance-grid,
  .ledger-split {
    grid-template-columns: 1fr;
  }

  .tea-form,
  .course-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-submit {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .tea-path {
    grid-template-columns: 1fr;
  }

  .customer-table-scroll {
    max-height: 520px;
  }

  .drawer {
    position: static;
    max-height: none;
  }
}

@media (max-width: 780px) {
  :root {
    --sidebar: 0px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 8;
    width: 286px;
    transform: translateX(-104%);
    transition: transform .2s ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu {
    display: block;
    flex: 0 0 auto;
  }

  .topbar {
    padding: 10px 12px;
  }

  .content {
    padding: 18px 12px 44px;
  }

  body.login-mode {
    overflow: auto;
  }

  body.login-mode .login-page {
    grid-template-columns: 1fr;
    align-items: end;
    min-height: 100svh;
    padding: 22px 16px;
  }

  .login-page {
    padding: 12px;
    place-items: start center;
  }

  .login-copy {
    padding-left: 0;
  }

  .login-copy .login-brand {
    margin-bottom: 54px;
  }

  .login-copy h1 {
    max-width: 10.5em;
    font-size: 30px;
  }

  h1 {
    font-size: 34px;
  }

  .login-copy .lead {
    max-width: 28em;
    font-size: 15px;
  }

  .login-tree {
    right: -34px;
    top: 112px;
    width: 168px;
    opacity: .36;
  }

  .login-panel {
    justify-self: end;
    width: min(430px, 100%);
    padding: 20px;
  }

  .import-panel,
  .product-stats,
  .admin-tools {
    grid-template-columns: 1fr;
    display: grid;
  }

  .catalog-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-table table {
    min-width: 700px;
  }

  .import-actions {
    min-width: 0;
    justify-items: start;
  }

  .finance-import-actions,
  .admin-reset-actions,
  .advisor-focus-actions {
    justify-content: flex-start;
  }

  .import-status {
    max-width: none;
    text-align: left;
  }

  .login-shell {
    min-height: auto;
    gap: 12px;
  }

  .tea-form,
  .course-form {
    grid-template-columns: 1fr;
  }

  .quick-submit {
    width: 100%;
  }

  .login-hero {
    min-height: auto;
    padding: 96px 22px 28px;
  }

  .login-hero::before {
    inset: 12px;
  }

  .login-hero::after {
    display: none;
  }

  .login-brand {
    left: 22px;
    top: 22px;
  }

  .login-hero h1 {
    margin-top: 0;
    font-size: 40px;
  }

  .login-hero .lead {
    font-size: 15px;
  }

  .login-card {
    padding: 20px;
    margin-bottom: 18px;
  }

  .login-orbit {
    height: 190px;
  }

  .tea-plate {
    width: 190px;
    height: 190px;
  }

  .tea-plate::before {
    inset: 36px;
  }

  .tea-plate::after {
    inset: 68px;
  }

  .page-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid,
  .material-strip {
    grid-template-columns: 1fr;
  }

  .user-pill[data-admin] {
    display: none;
  }

  .user-pill[data-logout] {
    min-width: 52px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
