@charset "UTF-8";

:root {
  --ink: #0E1B26;
  --ink-2: #162B39;
  --ink-3: #24404F;
  --paper: #F7F4EE;
  --surface: #FFFCF7;
  --surface-2: #F2EEE5;
  --surface-3: #EAE4D8;
  --line: rgba(14, 27, 38, 0.12);
  --line-soft: rgba(14, 27, 38, 0.07);
  --line-strong: rgba(14, 27, 38, 0.22);
  --copper: #C8A45C;
  --copper-deep: #A9822F;
  --copper-soft: rgba(200, 164, 92, 0.14);
  --teal: #12726B;
  --teal-deep: #0C5751;
  --teal-soft: rgba(18, 114, 107, 0.1);
  --coral: #D96C4F;
  --coral-soft: rgba(217, 108, 79, 0.12);
  --green: #3F7D5C;
  --green-soft: rgba(63, 125, 92, 0.12);
  --amber: #A9822F;
  --amber-soft: rgba(169, 130, 47, 0.14);
  --text: #1A2A35;
  --muted: #6B7A85;
  --faint: #98A5AE;
  --serif: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --radius: 3px;
  --shadow-1: 0 1px 0 rgba(14, 27, 38, 0.04);
  --shadow-2: 0 18px 42px rgba(14, 27, 38, 0.16);
  --side-w: 236px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

p {
  margin: 0;
}

a {
  color: var(--teal);
  text-decoration: none;
}

i,
em {
  font-style: normal;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--copper-soft);
}

.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.boot-mark svg {
  animation: lens-turn 6s linear infinite;
}

@keyframes lens-turn {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- app frame ---------------- */

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

.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: rgba(247, 244, 238, 0.82);
  border-right: 1px solid rgba(200, 164, 92, 0.22);
  z-index: 30;
}

.side::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(247, 244, 238, 0.09);
}

.side-brand .mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 164, 92, 0.5);
  border-radius: 50%;
}

.side-brand h1 {
  color: #F7F4EE;
  font-size: 17px;
  letter-spacing: 0.14em;
  line-height: 1.1;
}

.side-brand span {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: rgba(200, 164, 92, 0.85);
  margin-top: 5px;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 18px;
  scrollbar-width: thin;
}

.side-nav::-webkit-scrollbar {
  width: 4px;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(247, 244, 238, 0.14);
}

.nav-group {
  padding: 8px 0 4px;
}

.nav-group > p {
  padding: 0 18px;
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: rgba(247, 244, 238, 0.34);
  margin-bottom: 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 18px;
  color: rgba(247, 244, 238, 0.7);
  font-size: 13px;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.72;
}

.nav-item em {
  margin-left: auto;
  font-size: 11px;
  color: rgba(247, 244, 238, 0.34);
}

.nav-item:hover {
  color: #F7F4EE;
  background: rgba(247, 244, 238, 0.045);
}

.nav-item.is-on {
  color: #F7F4EE;
  background: linear-gradient(90deg, rgba(200, 164, 92, 0.14), transparent 68%);
}

.nav-item.is-on::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--copper);
}

.nav-item.is-on svg {
  opacity: 1;
  color: var(--copper);
}

.side-foot {
  border-top: 1px solid rgba(247, 244, 238, 0.09);
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-foot .who {
  min-width: 0;
  flex: 1;
}

.side-foot .who b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(247, 244, 238, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-foot .who span {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(247, 244, 238, 0.42);
}

.side-foot button {
  border: 1px solid rgba(247, 244, 238, 0.18);
  background: transparent;
  color: rgba(247, 244, 238, 0.66);
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  border-radius: 2px;
  cursor: pointer;
}

.side-foot button:hover {
  color: #F7F4EE;
  border-color: rgba(200, 164, 92, 0.6);
}

.main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(680px 300px at 82% -8%, rgba(200, 164, 92, 0.1), transparent 70%),
    var(--paper);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar .burger {
  display: none;
}

.topbar-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.topbar-title b {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}

.topbar-title span {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px dashed rgba(200, 164, 92, 0.66);
  color: var(--copper-deep);
  font-size: 11px;
  letter-spacing: 0.08em;
  border-radius: 2px;
  white-space: nowrap;
}

.demo-flag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
}

.store-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
}

.store-pick svg {
  color: var(--copper-deep);
}

.store-pick select {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  max-width: 168px;
  cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.user-chip b {
  color: var(--ink);
  font-weight: 600;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--copper);
  font-family: var(--serif);
  font-size: 13px;
  flex: none;
}

.workspace {
  padding: 22px 26px 46px;
  min-width: 0;
}

/* ---------------- page header ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.page-head h2 {
  font-size: 23px;
  line-height: 1.16;
  letter-spacing: 0.02em;
}

.page-head .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 620px;
}

.page-head .head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ruler {
  position: relative;
  height: 9px;
  margin-bottom: 18px;
  border-top: 1px solid var(--line-strong);
  overflow: hidden;
}

.ruler::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background-image: repeating-linear-gradient(90deg, rgba(200, 164, 92, 0.75) 0 1px, transparent 1px 9px);
  background-position: 0 0;
}

.ruler::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 2px;
  background: var(--copper);
}

/* ---------------- layout helpers ---------------- */

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

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

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

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

.grid-main {
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row.tight {
  gap: 6px;
}

.row.end {
  justify-content: flex-end;
}

.spacer {
  flex: 1;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.neg {
  color: var(--coral);
}

.pos {
  color: var(--green);
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.cap {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}

.small {
  font-size: 12px;
}

/* ---------------- card ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.card-head h3 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-head h3::before {
  content: "";
  width: 3px;
  height: 12px;
  background: var(--copper);
  display: inline-block;
}

.card-head .head-note {
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.card-head .head-extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 16px;
}

.card-body.flush {
  padding: 0;
}

.card-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- KPI ---------------- */

.kpi {
  position: relative;
  padding: 15px 15px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-left: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-bottom-left-radius: 50%;
  opacity: 0.8;
}

.kpi .kpi-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi .kpi-label svg {
  width: 13px;
  height: 13px;
  color: var(--copper-deep);
  opacity: 0.9;
}

.kpi .kpi-value {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
  margin-top: 8px;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.kpi .kpi-value small {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-left: 3px;
}

.kpi .kpi-foot {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi.is-alert {
  border-color: rgba(217, 108, 79, 0.32);
}

.kpi.is-alert .kpi-value {
  color: var(--coral);
}

/* ---------------- table ---------------- */

.tbl-wrap {
  width: 100%;
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl thead th {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(242, 238, 229, 0.5);
  white-space: nowrap;
}

.tbl tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

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

.tbl tbody tr:hover td {
  background: rgba(200, 164, 92, 0.055);
}

.tbl td.actions {
  text-align: right;
  white-space: nowrap;
}

.tbl .cell-strong {
  font-weight: 600;
  color: var(--ink);
}

.tbl .cell-sub {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}

.tbl th.num,
.tbl td.num {
  text-align: right;
}

.tbl-compact tbody td {
  padding: 7px 12px;
}

.tbl-compact thead th {
  padding: 8px 12px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12.5px;
  padding: 2px 4px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.link-btn:hover {
  border-bottom-color: rgba(18, 114, 107, 0.5);
}

.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pager .pg {
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.pager .pg:hover {
  border-color: var(--copper);
  color: var(--ink);
}

.pager .pg.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.pager .pg:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------- status pill ---------------- */

.st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2.5px rgba(107, 122, 133, 0.12);
  flex: none;
}

.st.ok {
  color: var(--green);
}

.st.ok::before {
  box-shadow: 0 0 0 2.5px var(--green-soft);
}

.st.warn {
  color: var(--amber);
}

.st.warn::before {
  box-shadow: 0 0 0 2.5px var(--amber-soft);
}

.st.danger {
  color: var(--coral);
}

.st.danger::before {
  box-shadow: 0 0 0 2.5px var(--coral-soft);
}

.st.info {
  color: var(--teal);
}

.st.info::before {
  box-shadow: 0 0 0 2.5px var(--teal-soft);
}

.st.mute {
  color: var(--faint);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.tag.copper {
  border-color: rgba(200, 164, 92, 0.5);
  color: var(--copper-deep);
  background: var(--copper-soft);
}

.tag.teal {
  border-color: rgba(18, 114, 107, 0.34);
  color: var(--teal);
  background: var(--teal-soft);
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 2px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:hover {
  border-color: var(--ink);
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}

.btn-copper {
  background: var(--copper);
  border-color: var(--copper);
  color: #2A1E07;
}

.btn-copper:hover {
  background: var(--copper-deep);
  border-color: var(--copper-deep);
  color: #1B1305;
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger {
  color: var(--coral);
  border-color: rgba(217, 108, 79, 0.42);
}

.btn-danger:hover {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.btn-sm {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}

.btn[disabled],
.btn.is-busy {
  opacity: 0.62;
  cursor: not-allowed;
}

.btn.is-busy::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 1.4px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ---------------- forms ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.field > label i {
  color: var(--coral);
  margin-left: 3px;
}

.field .hint {
  font-size: 11px;
  color: var(--faint);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #FFFDF8;
  color: var(--ink);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.textarea {
  height: auto;
  min-height: 66px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: #B4BFC7;
}

.input.is-bad,
.select.is-bad {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 49%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 51%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}

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

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: span 3;
}

.form-grid .span-full {
  grid-column: 1 / -1;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 180px;
}

.search-box svg {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  color: var(--faint);
  pointer-events: none;
}

.search-box .input {
  padding-left: 29px;
  height: 32px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.toolbar .select {
  height: 32px;
  width: auto;
  min-width: 104px;
}

.toolbar .input {
  height: 32px;
}

.toolbar .field {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.toolbar .field > label {
  font-size: 11.5px;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip.is-on {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.check input {
  accent-color: var(--teal);
  width: 14px;
  height: 14px;
}

/* ---------------- tabs ---------------- */

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  overflow-x: auto;
}

.tab {
  position: relative;
  height: 40px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-on {
  color: var(--ink);
  font-weight: 600;
}

.tab.is-on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--copper);
}

/* ---------------- charts ---------------- */

.chart {
  width: 100%;
}

.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.chart-legend i {
  width: 8px;
  height: 2px;
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) minmax(0, 2.1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.bar-row .bar-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #1B8B82);
  border-radius: 1px;
}

.bar-fill.copper {
  background: linear-gradient(90deg, var(--copper-deep), var(--copper));
}

.bar-row .bar-val {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------- timeline ---------------- */

.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: grid;
  grid-template-columns: 54px 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.tl-item:last-child {
  border-bottom: 0;
}

.tl-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  padding-top: 1px;
}

.tl-rail {
  position: relative;
  width: 14px;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.tl-rail::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -18px;
  width: 1px;
  background: var(--line);
}

.tl-item:last-child .tl-rail::before {
  display: none;
}

.tl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--copper);
  background: var(--surface);
  z-index: 1;
}

.tl-dot.is-done {
  background: var(--green);
  border-color: var(--green);
}

.tl-dot.is-live {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.tl-body {
  min-width: 0;
}

.tl-body b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.tl-body .meta {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}

.tl-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ---------------- appointment cards ---------------- */

.appt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 12px;
  padding: 14px;
}

.appt-card {
  border: 1px solid var(--line);
  border-left: 2px solid var(--copper);
  border-radius: 2px;
  background: #FFFDF8;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.appt-card.is-done {
  border-left-color: var(--green);
  background: rgba(63, 125, 92, 0.035);
}

.appt-card.is-cancel {
  border-left-color: var(--line-strong);
  opacity: 0.72;
}

.appt-card .ac-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.appt-card .ac-slot {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
}

.appt-card .ac-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
}

.appt-card .ac-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.appt-card .ac-foot {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* ---------------- drawer / modal ---------------- */

.overlay-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(14, 27, 38, 0.34);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: auto;
}

.scrim.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 640px;
  max-width: 96vw;
  background: var(--paper);
  border-left: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  transform: translateX(26px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
  box-shadow: var(--shadow-2);
}

.drawer.is-open {
  transform: none;
  opacity: 1;
}

.drawer.is-wide {
  width: 780px;
}

.drawer-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--ink);
  color: rgba(247, 244, 238, 0.92);
}

.drawer-head .dt {
  min-width: 0;
}

.drawer-head h3 {
  color: #F7F4EE;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.drawer-head .dt span {
  display: block;
  font-size: 11px;
  color: rgba(247, 244, 238, 0.5);
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.drawer-head .close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 244, 238, 0.22);
  background: transparent;
  color: rgba(247, 244, 238, 0.7);
  border-radius: 2px;
  cursor: pointer;
}

.drawer-head .close:hover {
  color: #F7F4EE;
  border-color: var(--copper);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 26px;
}

.drawer-foot {
  flex: none;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-foot .spacer {
  flex: 1;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.99);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal.is-wide {
  width: 800px;
}

.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-head h3 {
  font-size: 15.5px;
}

.modal-head .close {
  margin-left: auto;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
}

.modal-foot .spacer {
  flex: 1;
}

/* ---------------- toast ---------------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 190px;
  max-width: 380px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal);
  border-radius: 2px;
  box-shadow: 0 10px 26px rgba(14, 27, 38, 0.14);
  font-size: 12.5px;
  color: var(--text);
  animation: toast-in 0.2s ease;
}

.toast.is-error {
  border-left-color: var(--coral);
  color: #8B3B27;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ---------------- states ---------------- */

.skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sk {
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, #EDE7DB 8%, #F6F2EA 42%, #EDE7DB 74%);
  background-size: 220% 100%;
  animation: sk 1.15s linear infinite;
}

@keyframes sk {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.empty {
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  margin: 14px;
  background: rgba(242, 238, 229, 0.32);
}

.empty .ring {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid rgba(200, 164, 92, 0.6);
  display: grid;
  place-items: center;
  color: var(--copper-deep);
}

.empty h4 {
  font-size: 14.5px;
  margin-bottom: 5px;
}

.empty p {
  font-size: 12.5px;
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.7;
}

.empty .empty-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.error-panel {
  border: 1px solid rgba(217, 108, 79, 0.3);
  background: rgba(217, 108, 79, 0.06);
  border-radius: 2px;
  padding: 16px;
  margin: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.error-panel .ep-body {
  flex: 1;
  min-width: 0;
}

.error-panel b {
  color: #8B3B27;
  font-size: 13px;
}

.error-panel p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------------- detail blocks ---------------- */

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

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

.dl .dl-item {
  min-width: 0;
}

.dl .dl-item dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.dl .dl-item dd {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.section-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 10px;
}

.section-band:first-child {
  margin-top: 0;
}

.section-band h4 {
  font-size: 13.5px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-band h4::before {
  content: "";
  width: 3px;
  height: 11px;
  background: var(--copper);
}

.section-band .line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section-band .aside {
  font-size: 11.5px;
  color: var(--faint);
}

.kv-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.kv-line:last-child {
  border-bottom: 0;
}

.kv-line b {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.total-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(242, 238, 229, 0.6);
  border-radius: 2px;
}

.total-band .tv {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
}

.total-band .tv small {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--faint);
  margin-left: 6px;
}

.rx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: center;
}

.rx-table th,
.rx-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
}

.rx-table thead th {
  background: rgba(242, 238, 229, 0.6);
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.rx-table tbody th {
  font-weight: 500;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
  background: rgba(242, 238, 229, 0.35);
  white-space: nowrap;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
}

.slot {
  height: 32px;
  border: 1px solid var(--line);
  background: #FFFDF8;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.slot:hover {
  border-color: var(--teal);
}

.slot.is-on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.slot:disabled {
  color: var(--faint);
  background: var(--surface-2);
  cursor: not-allowed;
  text-decoration: line-through;
}

.pick-list {
  border: 1px solid var(--line);
  border-radius: 2px;
  max-height: 232px;
  overflow-y: auto;
  background: #FFFDF8;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  cursor: pointer;
}

.pick-row:last-child {
  border-bottom: 0;
}

.pick-row:hover {
  background: rgba(200, 164, 92, 0.07);
}

.pick-row.is-on {
  background: var(--teal-soft);
}

.pick-row .pr-main {
  flex: 1;
  min-width: 0;
}

.pick-row .pr-main b {
  font-weight: 600;
  color: var(--ink);
}

.pick-row .pr-main span {
  display: block;
  font-size: 11px;
  color: var(--faint);
}

.pick-row .pr-side {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row .mr-main {
  min-width: 0;
  flex: 1;
}

.mini-row .mr-main b {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row .mr-main span {
  font-size: 11px;
  color: var(--faint);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row .mr-val {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.log-row {
  display: grid;
  grid-template-columns: 130px 96px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  align-items: start;
}

.log-row:last-child {
  border-bottom: 0;
}

.log-row .lg-time {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

.log-row .lg-detail {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------------- login ---------------- */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--paper);
}

.login-side {
  position: relative;
  background: var(--ink);
  color: rgba(247, 244, 238, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 48px;
  overflow: hidden;
}

.login-side::before {
  content: "";
  position: absolute;
  right: -140px;
  top: 50%;
  width: 520px;
  height: 520px;
  transform: translateY(-50%);
  border: 1px solid rgba(200, 164, 92, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(200, 164, 92, 0.045), 0 0 0 118px rgba(200, 164, 92, 0.03);
}

.login-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(247, 244, 238, 0.045) 0 1px, transparent 1px 44px);
  pointer-events: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.login-brand h1 {
  color: #F7F4EE;
  font-size: 20px;
  letter-spacing: 0.2em;
}

.login-brand span {
  display: block;
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.36em;
  color: rgba(200, 164, 92, 0.9);
  margin-top: 6px;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 430px;
}

.login-copy h2 {
  color: #F7F4EE;
  font-size: 32px;
  line-height: 1.34;
  letter-spacing: 0.02em;
}

.login-copy p {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(247, 244, 238, 0.62);
}

.login-copy .flow {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(247, 244, 238, 0.5);
}

.login-copy .flow b {
  border: 1px solid rgba(200, 164, 92, 0.42);
  color: rgba(247, 244, 238, 0.82);
  font-weight: 400;
  padding: 3px 8px;
  border-radius: 2px;
}

.login-foot {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(247, 244, 238, 0.34);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.login-box {
  width: 100%;
  max-width: 372px;
}

.login-box .cap {
  margin-bottom: 10px;
}

.login-box h2 {
  font-size: 25px;
  letter-spacing: 0.03em;
}

.login-box .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 8px 0 22px;
}

.login-box .field {
  margin-bottom: 13px;
}

.login-box .btn {
  width: 100%;
  height: 38px;
  margin-top: 6px;
}

.login-hint {
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--copper);
  background: rgba(200, 164, 92, 0.07);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.8;
}

.login-meta {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.login-error {
  margin-top: 12px;
  min-height: 18px;
  font-size: 12px;
  color: var(--coral);
}

/* ---------------- misc ---------------- */

.code-box {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 11px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.split-line {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.lang-en {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.scroll-x {
  overflow-x: auto;
}

.side-scrim {
  display: none;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1380px) {
  .grid-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  :root {
    --side-w: 208px;
  }
  .workspace {
    padding: 18px 20px 40px;
  }
  .topbar {
    padding: 0 20px;
  }
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login-side {
    padding: 34px 32px;
  }
  .login-copy h2 {
    font-size: 26px;
  }
}

@media (max-width: 980px) {
  .grid-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .dl.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login {
    grid-template-columns: minmax(0, 1fr);
  }
  .login-side {
    display: none;
  }
  .drawer,
  .drawer.is-wide {
    width: 100%;
    max-width: 100vw;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .side.is-open {
    transform: none;
  }
  .side-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 27, 38, 0.4);
    z-index: 29;
    border: 0;
  }
  .side.is-open + .side-scrim {
    display: block;
  }
  .topbar .burger {
    display: grid;
  }
  .topbar {
    height: 54px;
    gap: 10px;
  }
  .topbar-title span {
    display: none;
  }
  .store-pick {
    display: none;
  }
  .user-chip {
    border-left: 0;
    padding-left: 0;
  }
  .user-chip .who {
    display: none;
  }
  .workspace {
    padding: 14px 14px 34px;
  }
  .page-head h2 {
    font-size: 20px;
  }
  .page-head .head-actions {
    margin-left: 0;
    width: 100%;
  }
  .grid-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid,
  .form-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2,
  .form-grid .span-3 {
    grid-column: span 1;
  }
  .dl,
  .dl.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .toast-root {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
  .toast {
    max-width: none;
  }
  .modal {
    width: calc(100vw - 20px);
  }
}
