:root {
  --ink: #163d3d;
  --text: #203736;
  --muted: #657875;
  --line: #dce5e1;
  --green: #287563;
  --paper: #fff;
  --page: #f5f7f5;
  --gold: #a9752a;
  --red: #ac403b;
  --blue: #2b698a;
  --radius: 6px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
button:hover {
  background: #edf3ef;
  border-color: #a7bbb1;
}
button:disabled {
  opacity: 0.65;
  cursor: wait;
}
button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
button.primary:hover {
  background: #25605a;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #b58a37;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #86afa0;
  outline-offset: 1px;
}
input,
select,
textarea {
  border: 1px solid #c6d5cf;
  background: #fff;
  border-radius: 4px;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--text);
  width: 100%;
  max-width: 100%;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  min-height: 24px;
  width: 24px;
  flex-shrink: 0;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
label > input,
label > select,
label > textarea {
  margin-top: 6px;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  line-height: 1.4;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 650;
}
small {
  font-size: 12px;
  color: var(--muted);
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 1.8;
}
.icon-button {
  width: 48px;
  height: 48px;
  padding: 12px;
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
.app-header {
  height: 80px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 23px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.brand span {
  font-size: 13px;
  font-weight: 400;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user > span {
  text-align: right;
  line-height: 1.5;
}
.user small {
  display: block;
}
.primary-nav {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  gap: 8px;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
}
.primary-nav button {
  border: none;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  min-width: 150px;
  background: transparent;
}
.primary-nav button.active {
  border-bottom-color: var(--green);
  color: var(--green);
  font-weight: 650;
}
.primary-nav b {
  color: var(--red);
  font-size: 12px;
}
.workspace {
  max-width: 1280px;
  margin: auto;
  padding: 32px 36px 80px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading p {
  margin-top: 6px;
  color: var(--muted);
}
.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar select {
  width: 180px;
}
.search {
  flex: 1;
  position: relative;
  max-width: 420px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 20px;
}
.search input {
  padding-left: 42px;
}
.toolbar input {
  margin: 0;
}
.search svg {
  top: 14px;
}
.client-list {
  background: #fff;
  border-top: 1px solid var(--line);
}
.client-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 130px 120px 110px 20px;
  width: 100%;
  text-align: left;
  justify-content: initial;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  gap: 20px;
  padding: 18px 20px;
  min-height: 86px;
}
.client-name {
  min-width: 0;
}
.client-name strong {
  display: block;
  font-size: 15px;
}
.client-name small {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.stage-label {
  font-size: 12px;
  color: var(--green);
  padding: 4px 8px;
  background: #eaf3ee;
  width: max-content;
  max-width: 100%;
  border-radius: 3px;
}
.stage-0,
.stage-1,
.stage-2 {
  background: #f6eddd;
  color: #93691f;
}
.stage-3,
.stage-4 {
  background: #eaf0f6;
  color: var(--blue);
}
.stage-5 {
  background: #fbefea;
  color: #934b3e;
}
.row-date,
.row-owner {
  font-size: 12px;
  color: var(--muted);
}
.state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.attendance-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  gap: 20px;
}
.attendance-band > div {
  display: flex;
  align-items: center;
  gap: 16px;
}
.attendance-band strong {
  display: block;
  font-size: 19px;
}
.attendance-band svg {
  color: var(--gold);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 14px;
}
.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}
.utility-band {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 28px;
}
.filter-owner {
  margin: 12px 0;
}
.pipeline {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.pipeline-track {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  margin-top: 18px;
}
.pipeline-track button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  display: block;
  padding: 8px;
  text-align: left;
  min-height: 88px;
}
.pipeline-track button span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.pipeline-track button strong {
  font-size: 28px;
  display: block;
  color: var(--ink);
  margin-top: 8px;
}
.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 32px;
}
.overview-columns .client-row {
  grid-template-columns: minmax(0, 1fr) 100px 20px;
}
.overview-columns .row-owner,
.overview-columns .row-date {
  display: none;
}
.company-pulse {
  padding-top: 24px;
}
.company-pulse > button {
  width: 100%;
  margin-top: 12px;
  justify-content: flex-start;
}
.metric-link {
  padding: 20px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  justify-content: space-between !important;
}
.metric-link strong {
  font-size: 20px;
}
.detail-back {
  margin-bottom: 18px;
}
.detail-back button {
  background: transparent;
  border: none;
  padding-left: 0;
}
.stage-timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  padding: 0;
  margin: 0 0 32px;
  gap: 10px;
}
.stage-timeline li {
  font-size: 12px;
  color: var(--muted);
  border-top: 2px solid var(--line);
  padding-top: 10px;
}
.stage-timeline li span {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}
.stage-timeline li.current {
  color: var(--ink);
  font-weight: 650;
  border-color: var(--gold);
}
.stage-timeline li.done {
  border-color: var(--green);
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 48px;
  align-items: start;
}
.detail-records section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.detail-records section:first-child {
  padding-top: 0;
  border: none;
}
.detail-records section > p {
  margin-top: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0 0;
}
.facts > div {
  min-width: 0;
}
.facts dt {
  color: var(--muted);
  font-size: 12px;
}
.facts dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.record {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.record:last-child {
  border: none;
}
.record > div:first-child {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.record p {
  margin: 10px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.record time {
  color: var(--muted);
  font-size: 12px;
}
.record button {
  margin-right: 8px;
}
.next-action {
  background: #fff;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: sticky;
  top: 88px;
}
.section-kicker {
  font-size: 12px;
  color: var(--muted);
}
.next-action h2 {
  margin: 8px 0 18px;
}
.next-action > button,
.next-action label {
  width: 100%;
  margin-top: 12px;
}
.next-action > small {
  display: block;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.file-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}
.file-list button {
  justify-content: flex-start;
  text-align: left;
  min-width: 0;
}
.file-list button > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.file-list small {
  display: block;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.photo-grid button {
  padding: 0;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e6eee9;
}
.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.history {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--muted);
  font-size: 12px;
}
.history summary {
  cursor: pointer;
  min-height: 48px;
  line-height: 48px;
}
.history p {
  margin: 10px 0;
}
.message-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  justify-content: initial;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  text-align: left;
  padding: 20px;
  gap: 20px;
}
.message-row > span {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 6px 12px;
}
.message-row small {
  grid-column: 2;
}
.message-row time {
  font-size: 12px;
  color: var(--muted);
}
.message-row.read {
  background: var(--page);
}
.finance-ledger button {
  width: 100%;
  justify-content: space-between;
  gap: 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 20px;
  text-align: left;
}
.finance-ledger small {
  display: block;
}
.people-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.people-list button {
  justify-content: space-between;
  min-width: 0;
  flex-wrap: wrap;
}
.people-list span {
  color: var(--muted);
  font-size: 12px;
}
.login {
  max-width: 440px;
  margin: 10vh auto;
  padding: 32px;
  background: #fff;
  border-top: 4px solid var(--ink);
}
.login-brand {
  font-size: 22px;
  font-weight: 650;
  color: var(--ink);
  padding-bottom: 32px;
}
.login-brand span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
}
.login h1 {
  font-size: 22px;
  margin-bottom: 22px;
}
.login label {
  margin-top: 20px;
}
.login .primary {
  width: 100%;
  margin-top: 20px;
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: #14393570;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog {
  background: #fff;
  border-radius: 6px;
  width: 560px;
  max-width: 100%;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 24px;
}
.dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.dialog form > label {
  margin-top: 18px;
}
.dialog form > .field { margin-top: 18px; }
.dialog .field { min-width: 0; }
.dialog input[type="date"] { min-width: 0; display: block; box-sizing: border-box; }
.action-guidance { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.action-guidance p { margin: 0 0 10px; }
.action-guidance[hidden], .action-guidance button[hidden] { display: none; }
.field > input, .field > select, .field > textarea { margin-top: 6px; }
.dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.form-error {
  color: var(--red);
  margin-top: 14px;
  overflow-wrap: anywhere;
}
.draft-status {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}
.check-list label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--text);
}
#workflow-toast {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  pointer-events: none;
}
#workflow-toast:empty {
  display: none;
}
.notice {
  color: var(--red);
  padding: 16px;
  background: #fff4ef;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.module-frame {
  width: 100%;
  border: 1px solid var(--line);
  height: calc(100dvh - 260px);
  min-height: 480px;
  background: #fff;
}
.attendance-embed-shell{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--paper,#f4f7fa);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.attendance-embed-shell>header{display:flex;align-items:center;gap:20px;flex:none;padding:8px 16px;border-bottom:1px solid var(--line);background:#fff}
.attendance-embed-shell>header button{min-height:44px;display:flex;align-items:center;gap:8px}
.attendance-embed-shell>.module-frame{display:block;flex:1;width:100%;height:0;min-height:0;border:0}
.preview-image {
  width: 100%;
  max-height: 60dvh;
  object-fit: contain;
  margin-top: 20px;
}
.preview-audio {
  width: 100%;
  margin-top: 20px;
}
.muted {
  color: var(--muted);
}
.account-menu > button {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin-top: 12px;
}
.dialog a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 10px;
}
.account-menu > p {
  margin-top: 14px;
}
@media (max-width: 900px) {
  .client-row {
    grid-template-columns: minmax(0, 1fr) 100px 20px;
  }
  .row-owner,
  .row-date {
    display: none;
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 24px;
  }
  .overview-columns {
    grid-template-columns: 1fr;
  }
  .company-pulse {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .company-pulse h2 {
    width: 100%;
  }
  .company-pulse > button {
    width: auto;
    flex: 1;
  }
  .stage-timeline {
    grid-template-columns: repeat(4, 1fr);
  }
  .pipeline-track {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .people-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .app-header {
    height: 72px;
    padding: 0 18px;
  }
  .brand {
    font-size: 21px;
    gap: 10px;
  }
  .brand span {
    display: none;
  }
  .user {
    gap: 8px;
  }
  .user > span {
    font-size: 12px;
    max-width: 140px;
    overflow-wrap: anywhere;
  }
  .primary-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 8px calc(env(safe-area-inset-bottom) + 4px);
    min-height: 72px;
    border-top: 1px solid var(--line);
    gap: 0;
  }
  .primary-nav button {
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 10px 2px;
    border-bottom: 0;
    border-top: 3px solid transparent;
    font-size: 12px;
    position: relative;
  }
  .primary-nav button.active {
    border-top-color: var(--green);
    border-bottom: 0;
  }
  .primary-nav button b {
    position: absolute;
    right: 12px;
    top: 5px;
  }
  .workspace {
    padding: 24px 18px 108px;
  }
  .page-heading {
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .page-heading h1 {
    font-size: 22px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .page-heading .heading-actions {
    flex-shrink: 0;
  }
  .heading-actions > button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .toolbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .toolbar .search {
    min-width: 150px;
  }
  .toolbar select {
    width: 120px;
    font-size: 12px;
  }
  .client-row {
    padding: 16px 12px;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 88px 16px;
  }
  .client-name strong {
    font-size: 14px;
  }
  .client-row svg {
    width: 16px;
  }
  .stage-label {
    font-size: 11px;
  }
  .attendance-band {
    padding-top: 4px;
  }
  .attendance-band .primary {
    padding: 10px 18px;
  }
  .detail-grid {
    display: flex;
    flex-direction: column;
    gap: 26px;
  }
  .next-action {
    position: static;
    order: -1;
    width: 100%;
    padding: 18px;
  }
  .next-action h2 {
    font-size: 18px;
    margin-bottom: 8px;
  }
  .next-action > small {
    margin-top: 16px;
  }
  .detail-records {
    width: 100%;
    min-width: 0;
  }
  .facts {
    gap: 16px;
  }
  .file-list {
    grid-template-columns: 1fr;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dialog-backdrop {
    padding: 12px;
    align-items: flex-start;
    overflow: auto;
  }
  .dialog {
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 18px;
  }
  .dialog h2 {
    font-size: 18px;
  }
  .dialog footer {
    position: sticky;
    bottom: -18px;
    background: #fff;
    padding-bottom: 16px;
  }
  .login {
    margin: 32px 18px;
    padding: 24px;
    max-width: none;
  }
  .people-list {
    grid-template-columns: 1fr;
  }
  .finance-ledger button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    padding: 16px 12px;
  }
  .finance-ledger button > span:nth-child(2) {
    grid-row: 2;
    grid-column: 1;
  }
  .finance-ledger svg {
    grid-column: 2;
    grid-row: 1;
  }
  .message-row {
    grid-template-columns: minmax(0, 1fr) 20px;
    padding: 16px 12px;
    gap: 10px;
  }
  .message-row time {
    grid-column: 1;
    grid-row: 2;
    margin-left: 36px;
  }
  .message-row > svg {
    grid-column: 2;
    grid-row: 1;
  }
  .company-pulse > button {
    flex-basis: calc(50% - 12px);
  }
  .module-frame {
    height: calc(100dvh - 250px);
    min-height: 450px;
  }
  .pipeline-track button strong {
    font-size: 25px;
  }
  .pipeline-track button span {
    font-size: 11px;
  }
  .stage-timeline {
    gap: 8px;
  }
  .detail-back {
    margin-bottom: 8px;
  }
}
