:root {
  color-scheme: light;
  --paper: oklch(97% 0.006 85);
  --surface: oklch(99% 0.004 85);
  --ink: oklch(25% 0.008 145);
  --muted: oklch(49% 0.01 145);
  --line: oklch(88% 0.008 85);
  --accent: oklch(58% 0.18 41);
  --dark: #232726;
  --orange: #d85325;
  --soft: #f6e6dd;
  --green: #367256;
  --radius: 10px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #e58b64;
  outline-offset: 3px;
}
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 42px;
  border-radius: 7px;
  padding: 10px 16px;
  font-weight: 600;
  transition: background 0.16s ease-out;
}
button:hover {
  background: #eeeae3;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf5;
}
button.primary:hover {
  background: #b9461e;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.danger {
  color: #b33d39;
}
input,
textarea,
select {
  border: 1px solid #c8cdc7;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #cf6d45;
  outline-offset: 2px;
}
textarea {
  resize: vertical;
  min-height: 105px;
}
label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
small,
.muted {
  color: var(--muted);
  font-weight: 400;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.75;
}
code,
.number {
  font-variant-numeric: tabular-nums;
}
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--dark);
  color: #e6e9e3;
  padding: 36px 20px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 1px;
}
.brand-mark {
  display: inline-flex;
  gap: 4px;
  transform: skew(-15deg);
  padding: 4px;
}
.brand-mark:before,
.brand-mark:after {
  content: "";
  width: 8px;
  height: 25px;
  background: #ed7541;
}
.brand-sub {
  font-size: 10px;
  color: #a7b1a9;
  letter-spacing: 3px;
  margin: 10px 0 42px 40px;
}
.nav-label {
  color: #929e96;
  font-size: 10px;
  letter-spacing: 2px;
  padding: 0 12px;
  margin-bottom: 14px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  color: #bfc9c2;
  text-align: left;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  min-height: 46px;
  font-weight: 500;
}
.nav button:hover {
  background: #333b35;
}
.nav button.active {
  background: #eee9df;
  color: #252b25;
}
.nav .nav-num {
  font-size: 10px;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #434a44;
  padding-top: 20px;
  font-size: 12px;
  line-height: 1.8;
  color: #a8b2ab;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ca686;
  margin-right: 7px;
}
.main {
  min-width: 0;
  padding: 0 44px 50px;
}
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 15px;
}
.breadcrumb {
  color: var(--muted);
  font-size: 12px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
}
.top-actions button {
  font-size: 12px;
  min-height: 36px;
  padding: 6px 10px;
}
.avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #eee9df;
  font-size: 12px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 34px 0 30px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 9px;
  max-width: 65ch;
}
.heading-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 24px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 25px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  gap: 25px;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.metric-value {
  font-size: 30px;
  letter-spacing: -0.7px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.metric-value .currency {
  font-size: 17px;
  vertical-align: 3px;
  margin-right: 3px;
}
.metric small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
}
.work-row {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 28px;
  margin: 28px 0;
}
.queue {
  padding: 24px;
  background: #e8e9e0;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.queue.secondary {
  background: #efebe2;
}
.queue .big {
  font-size: 28px;
  font-weight: 650;
  margin-right: 8px;
}
.queue p {
  font-size: 12px;
  margin-top: 7px;
  color: var(--muted);
}
.section {
  margin-top: 30px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 20px;
}
.section-title small {
  font-size: 12px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}
th {
  font-weight: 500;
  color: var(--muted);
  background: #f1f0e9;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 18px;
  border-bottom: 1px solid #e8e8df;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f7f5ee;
}
td small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
}
td .service-title {
  font-weight: 600;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #eee9df;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.badge:before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.badge.pending {
  color: #956719;
  background: #f9edce;
}
.badge.active {
  color: #386857;
  background: #e4efe7;
}
.badge.completed {
  color: #707871;
  background: #edf0ea;
}
.badge.open {
  color: #a45930;
  background: #f6e7dc;
}
.badge.resolved {
  color: #548061;
  background: #e7eee5;
}
.text-button {
  border: 0;
  padding: 4px 0;
  min-height: 32px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
}
.text-button:hover {
  background: transparent;
  text-decoration: underline;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar label {
  min-width: 140px;
}
.toolbar .search {
  flex: 1;
  min-width: 200px;
}
.toolbar label span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
}
.pagination div {
  display: flex;
  gap: 8px;
}
.pagination button {
  font-size: 12px;
  min-height: 36px;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 10px;
}
.empty p {
  font-size: 13px;
}
.error-box {
  padding: 18px;
  background: #f9e6df;
  color: #903c26;
  border-radius: 8px;
  line-height: 1.7;
}
.loading {
  padding: 50px;
  color: var(--muted);
}
.notice {
  padding: 12px 16px;
  background: #eeece3;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  border-radius: 6px;
  margin: 20px 0;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 28px;
}
.editor {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: var(--radius);
  align-self: start;
}
.editor h2 {
  margin-bottom: 24px;
}
.form-grid {
  display: grid;
  gap: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 36px;
}
.checkbox input {
  width: 18px;
  min-height: 18px;
}
.editor .form-error {
  color: #ad4230;
  font-size: 12px;
  line-height: 1.7;
}
.service-list {
  display: grid;
  gap: 0;
}
.service-row {
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  align-items: start;
}
.service-index {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: #e8e9e0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  flex-shrink: 0;
}
.service-info {
  flex: 1;
  min-width: 0;
}
.service-info p {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0;
  max-width: 48ch;
}
.service-price {
  font-size: 21px;
  font-weight: 650;
  margin-bottom: 12px;
  white-space: nowrap;
}
.service-price small {
  font-size: 12px;
}
.service-controls {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  min-height: 580px;
}
.conversation-list {
  border-right: 1px solid var(--line);
  max-height: 690px;
  overflow-y: auto;
}
.conversation {
  display: block;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  padding: 20px;
  background: transparent;
}
.conversation.selected {
  background: #edece1;
}
.conversation header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.conversation p {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.conversation small {
  font-size: 10px;
  display: block;
  margin-top: 10px;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 15px 22px;
  gap: 12px;
}
.messages {
  padding: 24px;
  flex: 1;
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}
.message {
  max-width: 85%;
}
.message.mine {
  align-self: flex-end;
}
.message-meta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 11px 15px;
  background: #f0f0e8;
  border-radius: 0 9px 9px 9px;
  font-size: 13px;
}
.message.mine p {
  background: #e8eede;
  border-radius: 9px 0 9px 9px;
}
.message small {
  display: block;
  margin-top: 5px;
}
.chat-compose {
  border-top: 1px solid var(--line);
  padding: 18px;
}
.chat-compose textarea {
  min-height: 85px;
}
.chat-compose footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.detail {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.detail dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  font-size: 13px;
}
.detail dt {
  color: var(--muted);
}
.detail dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.timeline {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
}
.timeline p {
  font-size: 12px;
}
.timeline small {
  font-size: 11px;
}
.settings-form {
  max-width: 760px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-story {
  background: var(--dark);
  padding: 64px 70px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #eeeae0;
}
.login-story h1 {
  font-size: 48px;
  line-height: 1.35;
  font-weight: 650;
  margin-top: auto;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.login-story p {
  color: #b4c0b5;
  font-size: 14px;
  max-width: 35ch;
}
.login-story .story-foot {
  margin-top: auto;
  padding-top: 90px;
  color: #9fae9f;
  font-size: 11px;
  letter-spacing: 2px;
}
.court-lines {
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid #4b5247;
  border-radius: 50%;
  right: -190px;
  top: 20%;
  pointer-events: none;
}
.court-lines:after {
  content: "";
  position: absolute;
  inset: 40px;
  border: 1px solid #4b5247;
  border-radius: 50%;
}
.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-form {
  width: 100%;
  max-width: 350px;
}
.login-form h2 {
  font-size: 26px;
  margin-bottom: 10px;
}
.login-form > p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
}
.login-form .form-actions button {
  width: 100%;
}
.login-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 25px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #29352b;
  color: #f6f4ed;
  border-radius: 8px;
  padding: 13px 22px;
  box-shadow: 0 6px 25px #1c281a20;
  z-index: 100;
  max-width: 90vw;
  font-size: 13px;
  display: none;
}
#toast.show {
  display: block;
}
.boot {
  padding: 40px;
}
.money-in {
  color: #316b4d;
}
.money-out {
  color: #ae502f;
}
.skeleton {
  height: 210px;
  background: #eeeee5;
  border-radius: 8px;
}
.compact-actions {
  display: flex;
  gap: 10px;
}
.status-note {
  font-size: 11px;
  margin-top: 24px;
  color: var(--muted);
}
@media (min-width: 1500px) {
  .main {
    padding-left: 64px;
    padding-right: 64px;
  }
  .page-heading {
    margin-top: 42px;
  }
  .metrics {
    padding-top: 35px;
    padding-bottom: 35px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 185px 1fr;
  }
  .main {
    padding: 0 25px 35px;
  }
  .sidebar {
    padding: 30px 14px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .editor {
    max-width: 760px;
  }
  .chat-layout {
    grid-template-columns: 250px 1fr;
  }
  .metrics {
    gap: 15px;
  }
  .metric-value {
    font-size: 25px;
  }
  .work-row {
    gap: 16px;
  }
  .queue {
    padding: 20px;
  }
  .top-actions .date-label {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px 18px 10px;
  }
  .brand {
    font-size: 19px;
  }
  .brand-sub,
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    gap: 4px;
    margin-top: 18px;
  }
  .nav button {
    min-width: 68px;
    justify-content: center;
    padding: 8px;
    min-height: 40px;
    font-size: 12px;
  }
  .nav-num {
    display: none;
  }
  .main {
    padding: 0 18px 30px;
  }
  .topbar {
    height: 62px;
  }
  .top-actions {
    gap: 8px;
  }
  .top-actions > a {
    display: none;
  }
  .page-heading {
    margin: 25px 0;
    display: block;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .heading-actions {
    padding-top: 16px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 27px;
  }
  .metric-value {
    font-size: 28px;
  }
  .work-row {
    grid-template-columns: 1fr;
  }
  .queue {
    padding: 20px;
  }
  .toolbar {
    gap: 10px;
  }
  .toolbar label {
    min-width: calc(50% - 10px);
    flex: 1;
  }
  .toolbar .search {
    flex-basis: 100%;
  }
  .chat-layout {
    display: block;
  }
  .conversation-list {
    max-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .conversation {
    padding: 14px;
  }
  .chat-head {
    padding: 15px;
  }
  .messages {
    padding: 16px;
    min-height: 230px;
  }
  .login {
    display: block;
  }
  .login-story {
    padding: 25px;
    min-height: 260px;
  }
  .login-story h1 {
    font-size: 29px;
    margin-top: 35px;
    margin-bottom: 10px;
  }
  .login-story p {
    font-size: 12px;
  }
  .login-story .story-foot {
    display: none;
  }
  .login-form-wrap {
    padding: 35px 25px;
  }
  .service-row {
    gap: 12px;
  }
  .service-index {
    width: 30px;
    height: 30px;
  }
  .service-price {
    font-size: 18px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .detail {
    padding: 18px;
  }
  .detail dl {
    grid-template-columns: 85px 1fr;
  }
  .editor {
    padding: 20px;
  }
  .top-actions .avatar {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
