:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #172326;
  background: #f4f7f7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #f4f7f7;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  min-height: calc(100vh - 34px);
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 1fr);
  background: #ffffff;
}

.auth-identity {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: inherit;
  padding: clamp(36px, 5vw, 76px);
  color: #f6fbfb;
  background: #23313a;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand .brand-mark {
  width: 46px;
  height: 46px;
  color: #123c3d;
  background: #7be0d0;
}

.auth-brand .brand-kicker {
  margin: 0 0 1px;
  color: #9cb1b9;
  font-size: 11px;
}

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

.auth-identity-title {
  padding: 48px 0;
}

.auth-identity-rule {
  display: block;
  width: 34px;
  height: 3px;
  background: #7be0d0;
}

.auth-identity-title p,
.auth-identity-footer {
  color: #9cb1b9;
  font-size: 11px;
  font-weight: 700;
}

.auth-identity-title p {
  margin: 22px 0 10px;
}

.auth-identity-title h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.25;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 52px clamp(24px, 7vw, 96px);
}

.auth-section-label {
  margin: 0 0 18px;
  color: #087f83;
  font-size: 12px;
  font-weight: 700;
}

.auth-description {
  margin: 0 0 36px;
  color: #66777d;
  font-size: 14px;
  line-height: 1.6;
}

.icp-footer {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-top: 1px solid rgba(216, 225, 226, 0.82);
  background: rgba(244, 247, 247, 0.94);
  font-size: 12px;
}

.icp-footer a {
  color: #6c7e81;
  text-decoration: none;
}

.icp-footer a:hover,
.icp-footer a:focus-visible {
  color: #087f83;
  text-decoration: underline;
}

.auth-card {
  width: min(100%, 400px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #ffffff;
  background: #087f83;
  font-size: 23px;
  font-weight: 800;
}

.brand-mark.compact {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.brand-kicker,
.section-kicker {
  margin: 18px 0 6px;
  color: #087f83;
  font-size: 12px;
  font-weight: 700;
}

.auth-card h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.3;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  color: #46595c;
  font-size: 14px;
  font-weight: 600;
}

.login-form input,
.search-control input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  color: #172326;
  background: #ffffff;
  outline: none;
}

.login-form input {
  height: 48px;
  padding: 0 14px;
  margin-bottom: 16px;
  border-color: #cbd9db;
  border-radius: 5px;
  background: #fbfcfc;
}

.login-form input::placeholder {
  color: #9caeb1;
}

.login-form input:focus,
.search-control input:focus,
select:focus {
  border-color: #087f83;
  box-shadow: 0 0 0 3px rgba(8, 127, 131, 0.12);
}

.login-form button {
  height: 48px;
  border: 0;
  border-radius: 5px;
  color: #ffffff;
  background: #087f83;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.login-form button:hover {
  background: #066c70;
}

.login-form button:active {
  transform: translateY(1px);
}

.login-form button:focus-visible {
  outline: 3px solid rgba(8, 127, 131, 0.3);
  outline-offset: 3px;
}

.login-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-error {
  min-height: 20px;
  margin: 2px 0 0;
  color: #b42318;
  font-size: 13px;
}

.dashboard {
  min-height: calc(100vh - 34px);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid #dce5e5;
  background: rgba(255, 255, 255, 0.96);
}

.topbar-brand,
.topbar-actions,
.records-toolbar,
.toolbar-controls {
  display: flex;
  align-items: center;
}

.topbar-brand {
  gap: 12px;
}

.topbar .brand-kicker {
  margin: 0 0 1px;
  font-size: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
}

.topbar-actions {
  gap: 10px;
}

.viewer-badge {
  padding: 6px 9px;
  border-radius: 4px;
  color: #31575b;
  background: #eef4f4;
  font-size: 12px;
  font-weight: 700;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #456064;
  font-size: 13px;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c9c67;
  box-shadow: 0 0 0 4px rgba(28, 156, 103, 0.12);
}

.live-status.error i {
  background: #cf3d32;
  box-shadow: 0 0 0 4px rgba(207, 61, 50, 0.12);
}

.icon-button,
.text-button,
.secondary-button,
.primary-button {
  border: 1px solid #cbd7d8;
  color: #294246;
  background: #ffffff;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.text-button,
.secondary-button,
.primary-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 600;
}

.primary-button {
  border-color: #087f83;
  color: #ffffff;
  background: #087f83;
}

.icon-button:hover,
.text-button:hover,
.secondary-button:hover {
  border-color: #087f83;
  color: #087f83;
}

.primary-button:hover {
  border-color: #066c70;
  color: #ffffff;
  background: #066c70;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.dashboard-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 54px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.management-section {
  margin-bottom: 28px;
  border-top: 1px solid #d8e2e3;
  border-bottom: 1px solid #d8e2e3;
  background: #ffffff;
}

.management-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid #e5ebec;
}

.management-heading h2 {
  margin: 0;
  font-size: 17px;
}

.management-heading span {
  color: #718286;
  font-size: 12px;
}

.event-view-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.event-picker {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #53676a;
  font-size: 12px;
  font-weight: 700;
}

.event-picker select {
  width: min(360px, 100%);
  min-width: 220px;
  padding: 0 28px 0 12px;
  text-overflow: ellipsis;
}

.event-picker select:disabled {
  color: #556a6c;
  opacity: 1;
}

.section-kicker {
  margin: 0 0 7px;
}

.page-heading h2,
.records-toolbar h2 {
  margin: 0;
  font-size: 24px;
}

.last-updated,
.records-toolbar p {
  margin: 0;
  color: #6c7e81;
  font-size: 13px;
}

.roster-band,
.knowledge-band,
.account-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  margin: 0;
  padding: 13px 22px;
  border-bottom: 1px solid #e5ebec;
  background: #ffffff;
}

.management-section > section:last-child {
  border-bottom: 0;
}

.general-knowledge-band {
  background: #ffffff;
}

.general-knowledge-band .knowledge-state {
  color: #26704c;
}

.general-knowledge-band .knowledge-state i {
  background: #1c9c67;
}

.general-knowledge-band .knowledge-state.warning {
  color: #9a561c;
}

.general-knowledge-band .knowledge-state.warning i {
  background: #d9862c;
}

.account-band h2 {
  margin: 0 0 5px;
  font-size: 17px;
}

.account-band p {
  margin: 0;
  color: #6c7e81;
  font-size: 13px;
}

.account-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #3562a7;
  font-size: 12px;
  font-weight: 700;
}

.account-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3562a7;
}

.knowledge-summary {
  min-width: 0;
}

.knowledge-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #3562a7;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3562a7;
}

.knowledge-state.warning {
  color: #9a561c;
}

.knowledge-state.warning i {
  background: #d9862c;
}

.knowledge-summary h2 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.35;
}

.knowledge-summary p {
  margin: 0;
  color: #6c7e81;
  font-size: 13px;
}

.roster-summary {
  min-width: 0;
}

.roster-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #26704c;
  font-size: 12px;
  font-weight: 700;
}

.roster-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c9c67;
}

.roster-state.warning {
  color: #9a561c;
}

.roster-state.warning i {
  background: #d9862c;
}

.roster-summary h2 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.35;
}

.roster-summary p {
  margin: 0;
  color: #6c7e81;
  font-size: 13px;
}

.roster-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 24px;
  border-top: 1px solid #d8e2e3;
  border-bottom: 1px solid #d8e2e3;
  background: #ffffff;
}

.metric {
  min-width: 0;
  padding: 22px 20px;
  border-right: 1px solid #e4ebeb;
}

.metric-button {
  width: 100%;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  color: inherit;
  background: #ffffff;
  text-align: left;
}

.metric-button:hover,
.metric-button:focus-visible {
  background: #f3f9f8;
}

.metric-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #087f83;
  outline-offset: -2px;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: #687a7d;
  font-size: 13px;
}

.metric strong {
  display: block;
  color: #172326;
  font-size: 30px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 7px;
  color: #718286;
  font-size: 11px;
}

.metric.primary strong {
  color: #087f83;
}

.metric.accent strong {
  color: #3562a7;
}

.metric.warm strong {
  color: #a45816;
}

.metric.muted strong {
  color: #596669;
}

.records-section {
  border-top: 1px solid #d8e2e3;
  border-bottom: 1px solid #d8e2e3;
  background: #ffffff;
}

.records-toolbar {
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border-bottom: 1px solid #e4ebeb;
}

.records-toolbar h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.toolbar-controls {
  gap: 10px;
}

.search-control {
  width: min(280px, 28vw);
}

.search-control input {
  padding: 0 13px;
}

select {
  min-width: 126px;
  padding: 0 30px 0 12px;
}

.table-frame {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid #edf1f1;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: #607276;
  background: #f8fafa;
  font-size: 12px;
  font-weight: 700;
}

td {
  color: #263b3f;
  font-size: 13px;
  line-height: 1.45;
}

.records-section table { min-width: 1180px; }
.records-section th:nth-child(1) { width: 105px; }
.records-section th:nth-child(2) { width: 190px; }
.records-section th:nth-child(3) { width: 115px; }
.records-section th:nth-child(4) { width: 125px; }
.records-section th:nth-child(5) { width: 145px; }
.records-section th:nth-child(6) { width: 205px; }
.records-section th:nth-child(7) { width: 150px; }
.records-section th:nth-child(8) { width: 95px; }

tbody tr:hover {
  background: #f6fbfb;
}

.type-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.type-badge.checkin {
  color: #087f83;
  background: #e6f6f5;
}

.type-badge.interest {
  color: #315d9c;
  background: #eaf0fa;
}

.type-badge.demo {
  color: #965017;
  background: #fff0df;
}

.type-badge.lead {
  color: #6a4b8a;
  background: #f0eafa;
}

.status-badge {
  color: #26704c;
  background: #e8f5ed;
}

.company-name {
  color: #172326;
  font-weight: 700;
}

.secondary-text {
  color: #718286;
}

.empty-state {
  padding: 60px 20px;
  color: #718286;
  text-align: center;
}

.import-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd7d8;
  border-radius: 8px;
  color: #172326;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(19, 42, 45, 0.22);
}

.import-dialog::backdrop {
  background: rgba(19, 35, 38, 0.48);
}

.import-form {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 40px);
  padding: 24px;
  overflow-y: auto;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-header .section-kicker {
  margin-bottom: 4px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 21px;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #cbd7d8;
  border-radius: 50%;
  color: #506568;
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  color: #334b4f;
  font-size: 13px;
  font-weight: 700;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  color: #172326;
  background: #ffffff;
}

.form-field select {
  height: 42px;
}

.form-field input:focus {
  border-color: #087f83;
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 127, 131, 0.12);
}

.knowledge-dialog {
  width: min(820px, calc(100vw - 32px));
}

.general-knowledge-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.attendance-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.attendance-panel {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 40px);
  padding: 24px;
  overflow-y: auto;
}

.attendance-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
  background: #f8fafa;
}

.attendance-overview > div {
  padding: 15px 16px;
  border-right: 1px solid #e2e9e9;
}

.attendance-overview > div:last-child {
  border-right: 0;
}

.attendance-overview span,
.attendance-overview strong {
  display: block;
}

.attendance-overview span {
  margin-bottom: 5px;
  color: #718286;
  font-size: 11px;
}

.attendance-overview strong {
  font-size: 23px;
}

.attendance-overview > div:nth-child(2) strong {
  color: #087f83;
}

.attendance-overview > div:nth-child(3) strong {
  color: #a45816;
}

.attendance-controls {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(210px, 0.65fr) minmax(150px, 0.35fr);
  gap: 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 42px;
  padding: 3px;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  background: #f3f6f6;
}

.segmented-control button {
  min-width: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  color: #5f7174;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.segmented-control button.active {
  color: #086d71;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(27, 55, 58, 0.12);
}

.attendance-search input,
.attendance-owner-filter select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  color: #172326;
  background: #ffffff;
  outline: none;
}

.attendance-search input:focus {
  border-color: #087f83;
  box-shadow: 0 0 0 3px rgba(8, 127, 131, 0.12);
}

.attendance-list-meta {
  margin: -4px 0 -8px;
  color: #718286;
  font-size: 12px;
}

.attendance-table-frame {
  position: relative;
  max-height: min(440px, 52vh);
  overflow: auto;
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
}

.attendance-table {
  min-width: 820px;
}

.attendance-table th {
  position: sticky;
  z-index: 1;
  top: 0;
}

.attendance-table th:nth-child(1) { width: 105px; }
.attendance-table th:nth-child(2) { width: 230px; }
.attendance-table th:nth-child(3) { width: 260px; }
.attendance-table th:nth-child(4) { width: 105px; }
.attendance-table th:nth-child(5) { width: 170px; }
.attendance-table th:nth-child(6) { width: 190px; }

.attendance-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.attendance-badge.checked {
  color: #087f83;
  background: #e6f6f5;
}

.attendance-badge.unchecked {
  color: #965017;
  background: #fff0df;
}

.empty-state.compact {
  padding: 38px 20px;
}

.attendance-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.manual-checkin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-action-button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #9fc9c9;
  border-radius: 4px;
  color: #087478;
  background: #f3fbfa;
  font-size: 12px;
  font-weight: 700;
}

.inline-action-button:hover {
  border-color: #087f83;
  background: #e8f7f5;
}

.inline-action-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.sales-accounts-dialog {
  width: min(980px, calc(100vw - 32px));
}

.sales-accounts-panel {
  display: grid;
  gap: 20px;
  max-height: calc(100vh - 40px);
  padding: 24px;
  overflow-y: auto;
}

.sales-accounts-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
}

.sales-account-list-panel,
.sales-account-form {
  min-width: 0;
  padding: 20px;
}

.sales-account-list-panel {
  border-right: 1px solid #dce5e5;
  background: #f8fafa;
}

.sales-account-list {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.sales-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d9e2e2;
  border-radius: 5px;
  color: #203437;
  background: #fff;
  text-align: left;
}

.sales-account-item.active {
  border-color: #087f83;
  box-shadow: 0 0 0 2px rgba(8, 127, 131, 0.09);
}

.sales-account-item span,
.sales-account-item strong,
.sales-account-item small {
  display: block;
}

.sales-account-item small {
  margin-top: 3px;
  color: #718286;
  font-size: 11px;
}

.sales-account-item em {
  flex: 0 0 auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.sales-account-item em.active {
  color: #16845b;
}

.sales-account-item em.inactive {
  color: #a45816;
}

.sales-account-form {
  display: grid;
  align-content: start;
  gap: 14px;
}

.account-active-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #40575a;
  font-size: 13px;
  font-weight: 700;
}

.account-active-control input {
  width: 17px;
  height: 17px;
}

.toast.error {
  border-color: #e4aaa5;
  color: #8f2921;
  background: #fff4f2;
}

.library-status-band {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(190px, 1fr) auto;
  align-items: center;
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
  background: #f7f9f9;
}

.library-status-band > div,
.library-status-band > a {
  min-height: 64px;
  padding: 12px 16px;
  border-right: 1px solid #dce5e5;
}

.library-status-band > div {
  display: grid;
  align-content: center;
  gap: 4px;
}

.library-status-band > div span {
  color: #718286;
  font-size: 11px;
}

.library-status-band > div strong {
  font-size: 14px;
}

.library-status-band > a {
  display: flex;
  align-items: center;
  border-right: 0;
  color: #087f83;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.managed-library {
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
}

.managed-library-heading,
.managed-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.managed-library-heading {
  padding: 14px 16px;
  border-bottom: 1px solid #e4ebeb;
  background: #f8fafa;
}

.managed-library-heading h3,
.managed-editor-heading h3 {
  margin: 0;
  font-size: 16px;
}

.managed-library-heading p {
  margin: 4px 0 0;
  color: #718286;
  font-size: 12px;
}

.managed-document-list {
  max-height: 230px;
  overflow-y: auto;
}

.managed-document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf1f1;
}

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

.managed-document-row:hover {
  background: #f6fbfb;
}

.managed-document-row > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.managed-document-row strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.managed-document-row span {
  color: #718286;
  font-size: 12px;
}

.document-edit-button {
  width: 56px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  color: #087f83;
  background: #ffffff;
  font-weight: 700;
}

.managed-document-empty {
  margin: 0;
  padding: 30px 16px;
  color: #718286;
  text-align: center;
  font-size: 13px;
}

.managed-editor {
  display: grid;
  gap: 16px;
  padding-top: 2px;
}

.managed-editor-heading {
  padding-bottom: 11px;
  border-bottom: 1px solid #e4ebeb;
}

.managed-editor-heading .section-kicker {
  margin-bottom: 3px;
}

.managed-editor-heading > span {
  color: #718286;
  font-size: 12px;
}

.managed-fields-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.5fr) minmax(140px, 0.7fr) minmax(150px, 0.7fr);
  gap: 12px;
}

.managed-dialog-actions .danger-button {
  margin-right: auto;
}

.danger-button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d7a29e;
  border-radius: 6px;
  color: #a13f35;
  background: #fff7f6;
  font-weight: 700;
}

.danger-button:hover {
  border-color: #b42318;
  color: #8f2018;
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.event-context {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
  background: #f7f9f9;
}

.event-context span {
  color: #718286;
  font-size: 12px;
}

.event-context strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.field-heading > span {
  color: #718286;
  font-size: 12px;
}

.knowledge-editor-field textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid #cbd7d8;
  border-radius: 6px;
  color: #172326;
  background: #ffffff;
  font: 14px/1.75 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.knowledge-editor-field textarea:focus {
  border-color: #087f83;
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 127, 131, 0.12);
}

.knowledge-editor-field textarea:disabled {
  background: #f2f5f5;
}

.form-field > span,
.preview-notice {
  color: #718286;
  font-size: 12px;
}

.import-preview {
  border-top: 1px solid #dce5e5;
  border-bottom: 1px solid #dce5e5;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #f8fafa;
}

.preview-metrics > div {
  padding: 14px;
  border-right: 1px solid #e2e9e9;
}

.preview-metrics > div:last-child {
  border-right: 0;
}

.preview-metrics span,
.preview-metrics strong {
  display: block;
}

.preview-metrics span {
  margin-bottom: 5px;
  color: #718286;
  font-size: 11px;
}

.preview-metrics strong {
  font-size: 21px;
}

.preview-notice {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid #e2e9e9;
}

.preview-table-frame {
  max-height: 230px;
  overflow: auto;
  border-top: 1px solid #e2e9e9;
}

.preview-table {
  min-width: 660px;
}

.preview-table th:nth-child(1) { width: 36%; }
.preview-table th:nth-child(2) { width: 22%; }
.preview-table th:nth-child(3) { width: 22%; }
.preview-table th:nth-child(4) { width: 20%; }

.preview-issues {
  display: grid;
  gap: 5px;
  max-height: 110px;
  margin: 0;
  padding: 12px 28px;
  overflow-y: auto;
  border-top: 1px solid #e2e9e9;
  color: #a13f35;
  font-size: 12px;
}

.preview-issues:empty {
  display: none;
}

.dialog-actions {
  justify-content: flex-end;
  position: sticky;
  z-index: 2;
  bottom: -24px;
  margin: 0 -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid #dce5e5;
  background: #ffffff;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid #9acabe;
  border-radius: 6px;
  color: #174c3f;
  background: #edf9f5;
  box-shadow: 0 12px 32px rgba(31, 63, 61, 0.16);
  font-size: 13px;
  font-weight: 700;
}

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

  .metric:nth-child(3) {
    border-right: 0;
  }

  .metric:nth-child(-n + 3) {
    border-bottom: 1px solid #e4ebeb;
  }

  .records-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .roster-band {
    align-items: flex-start;
  }

  .knowledge-band {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-controls {
    width: 100%;
  }

  .roster-band,
  .roster-actions,
  .knowledge-band,
  .knowledge-band > button {
    width: 100%;
  }

  .roster-band {
    align-items: stretch;
    flex-direction: column;
  }

  .roster-actions > button {
    flex: 1;
  }

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

  .preview-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .preview-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid #e2e9e9;
  }

  .search-control {
    width: auto;
    flex: 1;
  }

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

  .attendance-controls {
    grid-template-columns: 1fr 1fr;
  }

  .segmented-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 184px minmax(0, 1fr);
  }

  .auth-identity {
    min-height: 0;
    padding: 24px;
  }

  .auth-identity-title {
    padding: 22px 0 0;
  }

  .auth-identity-title p,
  .auth-identity-footer {
    display: none;
  }

  .auth-identity-title h2 {
    margin-top: 10px;
    font-size: 25px;
  }

  .auth-main {
    place-items: start center;
    padding: 42px 24px 60px;
  }

  .auth-card {
    width: min(100%, 400px);
  }

  .management-heading {
    padding: 14px 18px;
  }

  .roster-band,
  .knowledge-band,
  .account-band {
    min-height: 0;
    padding: 16px 18px;
  }

  .records-section table,
  .records-section tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .records-section thead {
    display: none;
  }

  .records-section tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5ebec;
  }

  .records-section tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 12px;
  }

  .records-section tbody td::before {
    display: block;
    margin-bottom: 3px;
    color: #718286;
    font-size: 11px;
    font-weight: 400;
    content: attr(data-label);
  }

  .records-section tbody td:nth-child(1)::before,
  .records-section tbody td:nth-child(8)::before {
    display: none;
  }

  .records-section tbody td:nth-child(2),
  .records-section tbody td:nth-child(5),
  .records-section tbody td:nth-child(6),
  .records-section tbody td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .records-section tbody td:nth-child(2) {
    font-size: 15px;
    font-weight: 700;
  }

  .records-section tbody td:nth-child(8) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-brand .brand-kicker,
  .live-status {
    display: none;
  }

  .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
  }

  .dashboard-main {
    padding: 24px 14px 44px;
  }

  .page-heading {
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }

  .event-view-controls,
  .event-picker,
  .event-picker select {
    width: 100%;
  }

  .event-view-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .event-picker select {
    min-width: 0;
  }

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

  .metric,
  .metric:nth-child(3) {
    border-right: 1px solid #e4ebeb;
    border-bottom: 1px solid #e4ebeb;
  }

  .metric:nth-child(even) {
    border-right: 0;
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .attendance-panel {
    padding: 18px;
  }

  .attendance-controls {
    grid-template-columns: 1fr;
  }

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

  .attendance-overview > div {
    padding: 12px;
  }

  .attendance-overview strong {
    font-size: 20px;
  }

  .attendance-actions > button {
    flex: 1;
  }

  .toolbar-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-control {
    flex-basis: 100%;
  }

  .toolbar-controls label:not(.search-control),
  .toolbar-controls select,
  .toolbar-controls .secondary-button {
    flex: 1;
  }

  .knowledge-editor-field textarea {
    min-height: 260px;
  }

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

  .library-status-band > a {
    grid-column: 1 / -1;
    min-height: 46px;
    border-top: 1px solid #dce5e5;
  }

  .managed-fields-grid {
    grid-template-columns: 1fr;
  }

  .managed-library-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .managed-library-heading > button {
    width: 100%;
  }

  .managed-dialog-actions {
    flex-wrap: wrap;
  }

  .managed-dialog-actions .danger-button {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-width: 980px) {
  .account-band {
    align-items: stretch;
    flex-direction: column;
  }

  .account-band > button {
    width: 100%;
  }

  .sales-accounts-layout {
    grid-template-columns: 1fr;
  }

  .sales-account-list-panel {
    border-right: 0;
    border-bottom: 1px solid #dce5e5;
  }
}

@media (max-width: 640px) {
  .viewer-badge {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sales-accounts-panel {
    padding: 18px;
  }

  .sales-account-list-panel,
  .sales-account-form {
    padding: 16px;
  }
}

@media (max-width: 360px) {
  .viewer-badge {
    display: none;
  }

  .roster-actions {
    flex-direction: column;
  }

  .roster-actions > button {
    width: 100%;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
