:root {
  color-scheme: light;
  --bg: #f4f9ff;
  --surface: #ffffff;
  --surface-soft: #eef6ff;
  --text: #102a43;
  --muted: #61758a;
  --line: #d9e7f6;
  --primary: #1f7ae0;
  --primary-dark: #1464c2;
  --accent: #16c5c7;
  --danger: #df3e23;
  --warning: #f59e0b;
  --shadow: 0 8px 24px rgba(41, 98, 153, 0.09);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

/* Dedicated todo management */
.todo-management-view {
  --todo-row-border: color-mix(in srgb, var(--line) 72%, transparent);
}

.todo-management-actions {
  align-items: flex-end;
}

.todo-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.todo-management-panel {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.todo-management-panel-header {
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--todo-row-border);
}

.todo-management-panel-header h2 {
  margin: 0 0 5px;
}

.todo-management-panel-header p {
  margin: 0;
}

.todo-management-list {
  display: flex;
  flex-direction: column;
}

.todo-management-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(110px, 0.32fr) 20px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 22px;
  border: 0;
  border-bottom: 1px solid var(--todo-row-border);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

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

.todo-management-row:hover {
  background: var(--surface-soft);
}

.todo-management-row:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
  outline-offset: -3px;
}

.todo-management-row.urgent-todo {
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.todo-management-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--primary);
  background: var(--surface-soft);
  font-size: 19px;
}

.todo-management-row.urgent-todo .todo-management-icon {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, white);
}

.todo-management-copy,
.todo-management-person {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.todo-management-kind,
.todo-management-copy small,
.todo-management-person small {
  color: var(--muted);
  font-size: 12px;
}

.todo-management-kind {
  color: var(--primary);
  font-weight: 750;
}

.todo-management-copy strong,
.todo-management-person strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-management-copy strong {
  font-size: 15px;
}

.todo-management-person {
  padding-left: 14px;
  border-left: 1px solid var(--todo-row-border);
}

.todo-management-person strong {
  font-size: 13px;
}

.todo-management-arrow {
  color: var(--muted);
}

.todo-management-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.todo-management-empty i {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 28px;
}

.todo-management-empty strong {
  margin-bottom: 6px;
  color: var(--text);
}

.approval-deleted-record {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-soft);
}

.approval-deleted-record strong {
  color: var(--text);
}

@media (max-width: 1100px) {
  .todo-management-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .todo-management-row {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
    padding: 15px 16px;
  }

  .todo-management-person {
    grid-column: 2 / 3;
    padding: 6px 0 0;
    border-left: 0;
  }

  .todo-management-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

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

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-input {
  width: 100%;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.searchable-select-input:focus {
  border-color: var(--primary);
  outline: 2px solid color-mix(in srgb, var(--primary) 18%, transparent);
}

.searchable-select-source {
  display: none !important;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.boot-screen,
.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #eef7f4, #f7f7f1);
}

.boot-card {
  display: grid;
  width: min(470px, calc(100% - 36px));
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.boot-copy {
  display: grid;
  gap: 5px;
}

.boot-copy strong {
  color: var(--text);
  font-size: 17px;
}

.boot-copy span {
  color: var(--muted);
  font-size: 13px;
}

.boot-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #cfe0ee;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: boot-spin 800ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .boot-spinner { animation-duration: 1600ms; }
}

.login-card {
  display: grid;
  width: min(440px, 100%);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card label,
.modal-form label,
.inline-field,
.search-box {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.login-card .login-remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.login-remember-option input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #123238;
  color: #eef8f7;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e9f7f4;
  color: var(--primary);
  font-weight: 800;
}

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

.brand-row span {
  margin-top: 3px;
  color: #a7c4c5;
  font-size: 13px;
}

.nav-list {
  display: flex;
  height: calc(100vh - 112px);
  flex-direction: column;
  gap: 8px;
}

.system-nav {
  margin-top: auto;
}

.nav-item {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c7dcde;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.workspace {
  width: min(1480px, 100%);
  min-width: 0;
  padding: 26px;
}

.topbar,
.action-bar,
.panel-header,
.user-box,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.user-box {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #ccdeef;
  border-radius: 7px;
  background: #ffffff;
  color: #315979;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-refresh-button:hover {
  border-color: #8bb9e5;
  background: #f2f8ff;
  color: #176fc5;
}

.topbar-refresh-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.topbar-refresh-button.is-refreshing i {
  animation: boot-spin 800ms linear infinite;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d8e2e2;
  border-radius: 999px;
  background: #f8fbfb;
  color: #526565;
  font-size: 12px;
  white-space: nowrap;
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}

.sync-todo-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.sync-todo-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.sync-todo-button:disabled {
  cursor: default;
}

.sync-status[data-status="loading"] .sync-status-dot,
.sync-status[data-status="saving"] .sync-status-dot {
  background: #0f8b8d;
  animation: sync-pulse 1s ease-in-out infinite;
}

.sync-status[data-status="error"] {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b42318;
}

.sync-status[data-status="error"] .sync-status-dot {
  background: #dc2626;
}

.sync-status[data-status="todo"] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 750;
}

.sync-status[data-status="todo"] .sync-status-dot { background: #f97316; }

.sync-status[data-status="clear"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  font-weight: 750;
}

.sync-status[data-status="clear"] .sync-status-dot { background: #22c55e; }

.sync-status-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

@keyframes sync-pulse {
  50% {
    opacity: 0.35;
  }
}

.beijing-clock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}

.primary-button,
.secondary-button,
.account-button,
.icon-button,
.link-button,
.danger-button,
.report-card {
  min-height: 40px;
  border-radius: 8px;
}

.primary-button {
  padding: 0 16px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.account-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--primary);
  font-weight: 900;
}

.account-button:hover {
  background: #eef7f4;
}

.icon-button,
.link-button {
  border: 0;
  background: transparent;
}

.icon-button {
  width: 42px;
  color: var(--muted);
  font-size: 28px;
}

.link-button {
  color: var(--primary);
  font-weight: 800;
}

.danger-button {
  padding: 0 14px;
  border: 1px solid #f1aaa4;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 800;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid,
.content-grid,
.report-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.overview-panel,
.dashboard-todo-panel {
  min-height: 600px;
  height: 100%;
}

.overview-panel {
  display: flex;
  flex-direction: column;
}

.business-overview {
  display: grid;
  min-height: 430px;
  flex: 1;
  gap: 14px;
}

[hidden] {
  display: none !important;
}

.dashboard-chart-switcher {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.chart-page-button {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.chart-page-button:hover,
.chart-page-button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: none;
}

.chart-page-button.active {
  width: auto;
}

.overview-header {
  align-items: end;
}

.overview-header p {
  margin-bottom: 0;
}

.date-range-controls {
  display: flex;
  gap: 10px;
}

.date-range-controls label {
  display: grid;
  min-width: 138px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.date-range-controls input {
  min-height: 36px;
}

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

.trend-summary > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 12px;
  background: #f5f8f7;
}

.trend-summary span,
.todo-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.trend-summary strong {
  grid-column: 2;
  overflow-wrap: anywhere;
  font-size: 19px;
}

.legend-dot {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.contract-dot,
.contract-point {
  fill: var(--primary);
  background: var(--primary);
}

.payment-dot,
.payment-point {
  fill: var(--accent);
  background: var(--accent);
}

.trend-chart-wrap {
  min-height: 360px;
  overflow-x: auto;
}

.trend-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.chart-grid-line {
  stroke: #dce5e1;
  stroke-width: 1;
}

.chart-y-label,
.chart-x-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-y-label {
  text-anchor: end;
}

.chart-x-label {
  text-anchor: middle;
}

.trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contract-line {
  stroke: var(--primary);
}

.payment-line {
  stroke: var(--accent);
}

.trend-point {
  stroke: #ffffff;
  stroke-width: 2;
}

.chart-empty {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: var(--muted);
}

.dashboard-todo-panel .todo-list {
  max-height: 540px;
  overflow-y: auto;
}

.todo-item .todo-kind {
  display: block;
  margin: 0 0 5px;
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.todo-item small {
  margin-top: 5px;
  line-height: 1.5;
}

.urgent-todo {
  border-color: #efc0ba;
  background: #fff8f7;
}

.transfer-summary {
  padding: 12px;
  border-left: 4px solid var(--primary);
  background: #f2f8f6;
}

.transfer-summary strong,
.transfer-summary span {
  display: block;
}

.transfer-summary span,
.transfer-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.transfer-option {
  display: flex !important;
  align-items: center;
  grid-template-columns: none;
}

.transfer-option input {
  width: 18px;
  min-height: 18px;
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
}

.opportunity-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.65fr);
}

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

.customer-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.65fr);
}

.customer-list-layout {
  min-width: 0;
}

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

.stats-table-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.stats-table-grid .panel {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .stats-table-grid {
    grid-template-columns: 1fr;
  }
}

.product-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.7fr);
}

.opportunity-alert-grid {
  margin-top: 14px;
}

.opportunity-stats,
.side-panels {
  display: grid;
  gap: 14px;
  align-self: start;
}

.report-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

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

.metric-card,
.panel,
.report-card,
.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.module-card {
  min-height: 150px;
  padding: 18px;
  text-align: left;
}

.module-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 20px;
}

.module-card span {
  color: var(--muted);
  line-height: 1.6;
}

.module-card:hover {
  border-color: var(--primary);
  background: #f2f8f6;
}

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

.material-home .module-card {
  min-height: 138px;
}

.material-summary {
  margin-top: 16px;
}

.demo-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.demo-record-table {
  min-width: 980px;
}

.demo-warning-panel {
  align-self: start;
}

.demo-warning-item {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border-left: 4px solid #b45309;
  background: #fff7ed;
}

.demo-warning-item button {
  padding: 0;
  color: #7a4210;
  font-weight: 900;
  text-align: left;
}

.demo-warning-item span,
.demo-warning-item small {
  color: #875326;
}

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

.person-detail-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.person-permission-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.permission-editor-hero {
  margin-bottom: 16px;
}

.permission-editor-hero h2 {
  margin: 0 0 6px;
}

.permission-editor-hero p {
  margin: 0;
  color: var(--muted);
}

.permission-editor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.permission-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.permission-card header h3 {
  margin: 0;
}

.permission-card header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.permission-scope-grid,
.permission-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

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

.permission-check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.permission-check-item input {
  width: 18px;
  height: 18px;
}

.permission-card.is-locked {
  opacity: .72;
}

.opportunity-detail-actions,
.contract-detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.demo-form-panel {
  max-width: 960px;
}

.demo-workflow-form {
  margin-top: 16px;
}

.demo-calendar-panel {
  margin-top: 16px;
}

.demo-calendar-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.demo-calendar-header h2 {
  margin: 0;
  font-size: 18px;
  text-align: center;
}

.demo-calendar-nav {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-size: 22px;
}

.demo-calendar-weekdays,
.demo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.demo-calendar-weekdays span {
  padding: 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.demo-calendar-day {
  min-width: 0;
  min-height: 94px;
  padding: 8px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.demo-calendar-day:nth-child(7n) {
  border-right: 1px solid var(--line);
}

.demo-calendar-day:nth-last-child(-n + 7) {
  border-bottom: 1px solid var(--line);
}

.demo-calendar-day.is-outside {
  background: #f5f7f7;
  color: #879496;
}

.demo-calendar-day.is-today .demo-calendar-date {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.demo-calendar-date {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 900;
}

.demo-booking-chip {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 4px 5px;
  overflow: hidden;
  border-left: 3px solid #27776f;
  border-radius: 4px;
  background: #e6f2ef;
  color: #174f4a;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-booking-chip.is-returned {
  border-color: #879496;
  background: #eef1f1;
  color: #607174;
}

.demo-current-booking {
  display: grid;
  width: 100%;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 0;
  border-left: 4px solid var(--primary);
  background: #f2f8f6;
  color: var(--text);
  text-align: left;
}

.demo-booking-detail-button {
  display: grid;
  width: 100%;
  min-height: 0;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.demo-booking-detail-button:hover {
  border-color: var(--primary);
  background: #f2f8f6;
}

.demo-booking-detail-button span,
.demo-booking-detail-button small {
  color: var(--muted);
}

.demo-current-booking.demo-booking-detail-button {
  border-left: 4px solid var(--primary);
  background: #f2f8f6;
}

.demo-future-bookings {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.permission-note {
  padding: 11px 12px;
  border-left: 4px solid var(--warning);
  background: #fff7ed;
  color: #7a4210;
}

.module-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.module-tab {
  min-width: 126px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.module-tab:last-child {
  border-right: 0;
}

.module-tab.active {
  background: var(--primary);
  color: #fff;
}

.inventory-action-bar {
  justify-content: space-between;
}

.inventory-command-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.inventory-section {
  margin-top: 16px;
}

.inventory-value-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4px 18px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #b9d5cf;
  border-radius: 10px;
  background: linear-gradient(135deg, #edf7f4, #f8fbfa);
}

.inventory-value-summary span {
  color: var(--muted);
  font-weight: 800;
}

.inventory-value-summary strong {
  grid-row: span 2;
  justify-self: end;
  color: var(--primary);
  font-size: 30px;
}

.inventory-value-summary small {
  color: var(--muted);
}

.stock-zero,
.amount-negative {
  color: var(--danger);
}

.amount-positive {
  color: #167044;
}

.inventory-formula-table,
.inventory-record-table {
  min-width: 1020px;
}

.formula-part {
  display: inline-flex;
  margin: 2px 5px 2px 0;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

.inventory-movement-form {
  display: grid;
  gap: 16px;
}

.inventory-movement-lines {
  display: grid;
  gap: 10px;
}

.inventory-movement-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(110px, 0.6fr) minmax(130px, 0.7fr) 42px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.inventory-movement-row.is-csv-draft {
  grid-template-columns: minmax(150px, 1.4fr) minmax(90px, 0.55fr) minmax(100px, 0.6fr) minmax(130px, 0.75fr) minmax(150px, 1fr) 42px;
}

.inventory-import-status {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 11px;
}

.inventory-csv-draft-notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 7%, white);
}

.inventory-csv-draft-notice span,
.inventory-empty-draft {
  color: var(--muted);
  font-size: 13px;
}

.inventory-empty-draft {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.inventory-movement-row label,
.inventory-form-grid label,
.formula-component-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inventory-row-remove {
  align-self: end;
}

.inventory-add-line {
  justify-self: start;
}

.inventory-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.composition-picker-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.composition-picker-summary span {
  color: var(--muted);
  font-size: 13px;
}

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

.composition-check {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.composition-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #b7dfc8;
  border-radius: 8px;
  background: #effaf3;
}

.composition-item b {
  color: #167044;
}

.composition-item.is-missing {
  border-color: #f0aaa4;
  background: #fff1f0;
}

.composition-item.is-missing b {
  color: var(--danger);
}

.formula-components {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.formula-components-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#formulaComponentRows {
  display: grid;
  gap: 9px;
}

.formula-component-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(100px, 0.6fr) 42px;
  align-items: end;
  gap: 10px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.report-card-grid .report-card {
  min-height: 120px;
  padding: 16px;
  color: var(--primary);
  font-weight: 900;
  text-align: center;
}

.metric-card,
.panel {
  min-width: 0;
  padding: 16px;
}

.content-grid > * {
  min-width: 0;
}

.metric-card span,
.metric-card small,
.panel-header p,
.detail-sub,
.hint,
td span,
.mini-card span,
.payment-item span,
.timeline-item span,
.log-item span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header.compact {
  display: block;
}

.action-bar {
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 14px;
}

.customer-action-bar,
.opportunity-action-bar {
  justify-content: flex-start;
}

.settings-template-actions {
  justify-content: flex-start;
  gap: 6px;
}

.filter-menu {
  position: relative;
  flex: 0 0 auto;
}

.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(560px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(9, 36, 39, 0.18);
}

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

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

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.search-box {
  min-width: min(340px, 100%);
}

.search-box.compact-filter {
  flex: 1 1 170px;
  min-width: min(170px, 100%);
  max-width: 220px;
}

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

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

.table-thumbnail {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f4;
  object-fit: cover;
}

.table-thumbnail-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.opportunity-table {
  min-width: 1120px;
}

.opportunity-table th:nth-child(1),
.opportunity-table td:nth-child(1) {
  min-width: 220px;
}

.opportunity-table th:nth-child(2),
.opportunity-table td:nth-child(2) {
  min-width: 190px;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

td span {
  margin-top: 4px;
  font-size: 13px;
}

.selected-row {
  background: #eef7f4;
}

.danger-row {
  background: #fff7f6;
}

.ended-row td {
  background: #f0f2f2;
  color: #718083;
}

.ended-row:hover td {
  background: #e8ebeb;
}

.failed-row td {
  background: #fff1f0;
  color: #8f342d;
}

.failed-row:hover td {
  background: #ffe7e4;
}

[data-open-customer],
[data-open-person],
[data-open-product],
[data-open-contract],
[data-open-payment],
[data-open-tender],
[data-open-demo],
[data-open-demo-booking],
[data-open-inventory-item],
[data-open-inventory-record],
[data-open-opportunity] {
  cursor: pointer;
}

tr[data-open-customer]:hover,
tr[data-open-person]:hover,
tr[data-open-product]:hover,
tr[data-open-contract]:hover,
tr[data-open-payment]:hover,
tr[data-open-tender]:hover,
tr[data-open-training]:hover,
tr[data-open-demo]:hover,
tr[data-open-demo-booking]:hover,
tr[data-open-inventory-item]:hover,
tr[data-open-inventory-record]:hover,
tr[data-open-opportunity]:hover {
  background: #f2f8f6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f6eadf;
  color: var(--warning);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.muted-pill {
  background: #e8eef0;
  color: #53676a;
}

.warning-pill {
  background: #fff7ed;
  color: #9a5b13;
}

.available-pill {
  background: #dcfce7;
  color: #167044;
}

.reservation-pill {
  background: #e9e7ff;
  color: #5147a8;
}

.detail-panel {
  align-self: start;
}

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

.tag-grid span {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.opportunity-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.field-grid article {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

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

.field-grid strong {
  overflow-wrap: anywhere;
}

.remark-box {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.remark-box span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.milestone-timeline {
  display: grid;
  grid-template-columns: repeat(10, minmax(116px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 12px;
}

.milestone-node {
  position: relative;
  display: grid;
  min-height: 78px;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.milestone-node::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #b7c7c5;
}

.milestone-node.done {
  background: #eef7f4;
  border-color: #b8d8d2;
}

.milestone-node.done::before,
.milestone-node.current::before {
  background: var(--primary);
}

.milestone-node.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 94, 99, 0.12);
}

.milestone-node.failed,
.milestone-node.failed-origin {
  border-color: #c84b42;
  background: #fff1f0;
  box-shadow: 0 0 0 2px rgba(200, 75, 66, 0.12);
}

.milestone-node.failed::before,
.milestone-node.failed-origin::before {
  background: #c84b42;
}

.milestone-node span {
  color: var(--muted);
  font-size: 12px;
}

.mini-card,
.payment-item,
.timeline-item,
.log-item,
.todo-item {
  margin-top: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.mini-card-button {
  width: 100%;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
}

.mini-card-button:hover,
.selected-card {
  border-color: var(--primary);
  background: #f2f8f6;
}

.contact-detail-card {
  margin-top: 12px;
}

.contact-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.contact-summary strong {
  margin: 0;
}

.contact-summary span {
  margin: 0;
  text-align: right;
}

.customer-contact-opportunity-group {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.customer-contact-group-head,
.customer-contact-inquiry-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-summary-button {
  display: grid;
  flex: 1;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.contact-summary-button span,
.customer-contact-inquiry-head span {
  color: var(--muted);
}

.customer-contact-inquiry-head strong {
  flex: 1;
}

.customer-contact-inquiry-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  border-left: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.customer-contact-detail-grid {
  margin: 0;
}

.legacy-unassigned-group {
  border-color: var(--warning);
  background: #fffaf0;
}

.ended-card {
  border-color: #cfd6d6;
  background: #f0f2f2;
  color: #6d7b7d;
}

.ended-banner {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-left: 4px solid #7a898b;
  background: #eef1f1;
  color: #536366;
  font-size: 13px;
  line-height: 1.6;
}

.failed-banner {
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #f1b6b0;
  border-radius: 10px;
  color: #8f342d;
  background: #fff1f0;
  font-weight: 700;
}

.failed-pill {
  color: #a63e35 !important;
  background: #fff0ed !important;
}

.public-pool-banner {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-left: 4px solid var(--warning);
  background: #fff7ed;
  color: #7a4210;
  font-size: 13px;
  line-height: 1.6;
}

.public-pool-claim-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.public-pool-claim-bar .primary-button {
  flex: 0 0 auto;
}

.form-section-title {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
}

.opportunity-customer-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--primary, #14422d) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary, #14422d) 7%, white);
  color: var(--text-secondary, #5f6e66);
}

.opportunity-customer-summary strong { color: var(--text-primary, #17211c); font-size: 16px; }
.opportunity-detail-customer-card { margin: 14px 0 18px; }
.customer-opportunity-equipment { display: block; margin-top: 7px; line-height: 1.5; }
.opportunity-equipment-rows { display: grid; gap: 10px; }
.opportunity-equipment-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 12px; align-items: end; }
.opportunity-equipment-row .secondary-button { margin-bottom: 1px; }

.opportunity-equipment-card {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 5%, white);
}

.opportunity-equipment-card-head,
.opportunity-equipment-detail-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.opportunity-equipment-card-head > div {
  display: grid;
  gap: 5px;
}

.opportunity-equipment-card-head > div > span,
.opportunity-equipment-detail-list small {
  color: var(--muted);
  font-size: 13px;
}

.opportunity-equipment-card-head > div > strong {
  font-size: 19px;
}

.opportunity-equipment-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.opportunity-equipment-detail-list article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.opportunity-equipment-detail-list article > div {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.opportunity-equipment-detail-list article > div strong {
  overflow-wrap: anywhere;
}

.opportunity-equipment-detail-list article > b {
  flex: 0 0 auto;
  color: var(--primary);
}

.opportunity-equipment-index {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-container, #e4f2e9);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 720px) {
  .opportunity-equipment-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .opportunity-equipment-row .secondary-button { grid-column: 1 / -1; justify-self: end; }
  .opportunity-equipment-card-head { align-items: flex-start; }
  .opportunity-equipment-detail-list article { align-items: flex-start; }
}

.timeline-button {
  width: 100%;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
}

.timeline-button:hover {
  border-color: var(--primary);
  background: #f2f8f6;
}

.todo-button {
  width: 100%;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
}

.todo-button:hover {
  border-color: var(--primary);
  background: #f2f8f6;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}

.attachment-chip:hover {
  border-color: var(--primary);
  background: #eef7f4;
}

.attachment-manage {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.attachment-manage-header,
.attachment-manage-item,
.attachment-file-summary,
.attachment-delete-button {
  display: flex;
  align-items: center;
}

.attachment-manage-header {
  justify-content: space-between;
  gap: 12px;
}

.attachment-manage-header small,
.attachment-file-copy small {
  color: var(--muted);
  font-size: 12px;
}

.attachment-manage-list {
  display: grid;
  gap: 8px;
}

.attachment-manage-item {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dfe8e4;
  border-radius: 10px;
  background: #fbfdfc;
  transition: border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.attachment-file-summary {
  min-width: 0;
  gap: 10px;
}

.attachment-file-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: #edf6f2;
  color: var(--primary);
  font-size: 17px;
}

.attachment-file-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-file-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-delete-button {
  flex: 0 0 auto;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #f0c9c5;
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.attachment-delete-button:hover {
  border-color: var(--danger);
  background: #fff5f4;
}

.attachment-manage-item.is-pending-delete {
  border-color: #efc7c2;
  background: #fff7f6;
}

.approval-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.approval-summary-strip article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.approval-summary-strip article > i {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 11px;
  background: #eaf4ff;
  color: #247de3;
  font-size: 22px;
}

.approval-summary-strip span {
  color: var(--muted);
  font-size: 13px;
}

.approval-summary-strip strong {
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--text);
  font-size: 26px;
}

.approval-management-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.82fr) minmax(620px, 1.7fr);
  gap: 16px;
  align-items: start;
}

.approval-pending-panel,
.approval-records-panel {
  min-width: 0;
  min-height: 560px;
}

.approval-panel-header {
  align-items: flex-start;
}

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

.approval-panel-header p {
  margin-top: 5px;
}

.approval-count-badge {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff0df;
  color: #b55d00;
  font-size: 14px;
  font-weight: 900;
}

.approval-count-badge.neutral {
  background: #eaf4ff;
  color: #2473c8;
}

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

.approval-work-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  width: 100%;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #d9e6f2;
  border-radius: 11px;
  background: #fbfdff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.approval-work-item:hover {
  border-color: #8cbbe9;
  background: #f2f8ff;
  transform: translateY(-1px);
}

.approval-work-item.is-urgent {
  border-left: 4px solid #ed7a46;
  background: #fffaf5;
}

.approval-work-item.is-complete {
  border-left: 4px solid #38a675;
}

.approval-work-item.is-muted {
  opacity: 0.78;
}

.approval-work-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: #eaf4ff;
  color: #247de3;
  font-size: 22px;
}

.approval-work-item.is-urgent .approval-work-icon {
  background: #fff0e4;
  color: #d65f24;
}

.approval-work-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.approval-work-kind {
  color: #4d7192;
  font-size: 12px;
  font-weight: 800;
}

.approval-work-copy strong {
  overflow: hidden;
  color: #173652;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-work-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-work-arrow {
  color: #8ba2b8;
  font-size: 18px;
}

.approval-empty-state,
.approval-table-empty {
  color: var(--muted);
  text-align: center;
}

.approval-empty-state {
  display: grid;
  min-height: 280px;
  place-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #cbdceb;
  border-radius: 11px;
  background: #fbfdff;
}

.approval-empty-state i {
  color: #3aa879;
  font-size: 36px;
}

.approval-empty-state strong {
  color: #31516d;
}

.approval-record-table-wrap table {
  min-width: 980px;
}

.approval-record-table-wrap td:first-child {
  min-width: 230px;
  max-width: 320px;
}

.approval-record-table-wrap td:nth-child(5) {
  min-width: 145px;
}

.approval-relation-label,
.approval-archived-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf5fd;
  color: #326faa;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.approval-archived-label {
  margin-top: 4px;
  background: #eef1f4;
  color: #687c8d;
}

.approval-table-empty {
  padding: 54px 20px;
}

@media (max-width: 1360px) {
  .approval-management-grid {
    grid-template-columns: 1fr;
  }

  .approval-pending-panel,
  .approval-records-panel {
    min-height: 0;
  }

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

@media (max-width: 760px) {
  .approval-summary-strip,
  .approval-work-list {
    grid-template-columns: 1fr;
  }

  .approval-summary-strip article {
    padding: 11px 13px;
  }
}

.approval-summary,
.approval-detail-head,
.approval-error {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border-color, #d7e2df);
  border-radius: 14px;
  background: #f7faf9;
}

.approval-summary span,
.approval-summary small,
.approval-detail-head p,
.approval-error span {
  color: var(--muted-color, #60706d);
}

.approval-people-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.approval-person-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-color, #d7e2df);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.approval-person-option:has(input:checked) {
  border-color: #24766c;
  background: #edf8f5;
}

.approval-person-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.approval-person-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.approval-person-option small {
  color: var(--muted-color, #60706d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.approval-meta-grid article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: #f3f7f6;
}

.approval-meta-grid span {
  color: var(--muted-color, #60706d);
  font-size: 12px;
}

.approval-decision-list {
  display: grid;
  gap: 8px;
}

.approval-decision-list article {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(72px, auto) minmax(160px, 2fr);
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border-color, #d7e2df);
  border-radius: 11px;
}

.approval-decision-list b[data-status="approved"] { color: #15704d; }
.approval-decision-list b[data-status="rejected"] { color: #b42318; }
.approval-decision-list b[data-status="pending"] { color: #9a6700; }
.approval-decision-list b[data-status="withdrawn"] { color: var(--muted-color, #60706d); }
.approval-decision-list small { color: var(--muted-color, #60706d); }

.approval-inventory-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dce7e1;
  border-radius: 16px;
  background: #f7fbf8;
}

.approval-inventory-card > div { display: grid; gap: 8px; }
.approval-inventory-card article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
}
.approval-inventory-card span { color: var(--text-color, #26342d); }
.approval-inventory-card b { flex: none; color: var(--primary-color, #176b4d); }

.approval-download-action {
  display: flex;
  justify-content: flex-end;
}
.approval-terminal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; align-items: center; }
.approval-terminal-actions small { flex-basis: 100%; color: var(--muted-color, #60706d); text-align: right; }

@media (max-width: 720px) {
  .approval-people-picker,
  .approval-meta-grid { grid-template-columns: 1fr; }
  .approval-decision-list article { grid-template-columns: 1fr auto; }
  .approval-decision-list small { grid-column: 1 / -1; }
}

.attachment-manage-item.is-pending-delete .attachment-file-copy strong {
  color: var(--muted);
  text-decoration: line-through;
}

.attachment-manage-item.is-pending-delete [data-attachment-status] {
  color: var(--danger);
}

.attachment-delete-button.is-undo {
  border-color: #b9d6cd;
  color: var(--primary);
}

.attachment-manage-empty {
  padding: 14px;
  border-radius: 9px;
  background: #f7faf9;
  color: var(--muted);
  text-align: center;
}

.person-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.product-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.product-thumbnail {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.product-thumbnail-placeholder {
  display: grid;
  place-items: center;
  background: #eef7f4;
  color: var(--primary);
  font-size: 32px;
  font-weight: 900;
}

.product-image-manage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.product-image-manage img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.product-image-manage label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.avatar-large {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #eef7f4;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 30px;
  font-weight: 900;
}

.quote-product-list {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.quote-product-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.quote-product-item span {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

.wide-button {
  width: 100%;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.section-title-row h3 {
  margin: 0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f1aaa4;
  border-radius: 8px;
  background: #fff7f6;
}

.end-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #b9c6c7;
  border-radius: 8px;
  background: #f2f5f5;
}

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

.opportunity-terminal-actions .fail-zone,
.opportunity-terminal-actions .end-zone {
  min-width: 0;
}

.fail-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f1b6b0;
  border-radius: 10px;
  background: #fff7f6;
}

.fail-zone span {
  color: var(--muted);
  font-size: 13px;
}

.fail-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #c84b42;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.failed-node-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid #f1b6b0;
  border-radius: 10px;
  background: #fff7f6;
}

.end-zone span {
  color: var(--muted);
  font-size: 13px;
}

.end-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #809193;
  border-radius: 8px;
  background: #ffffff;
  color: #425558;
  font-weight: 800;
  white-space: nowrap;
}

.danger-zone span {
  color: var(--muted);
  font-size: 13px;
}

.mini-card strong,
.payment-item strong,
.timeline-item strong,
.log-item strong {
  display: block;
  margin-bottom: 5px;
}

.danger {
  border-color: #f3b5b0;
  background: #fff5f5;
}

.chart-box {
  min-height: 190px;
}

.chart-box svg {
  width: 100%;
  height: auto;
}

.bar-row,
.summary-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 110px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 13px;
}

.bar-row div {
  height: 12px;
  border-radius: 999px;
  background: #e6eeee;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.pie-chart {
  width: 150px;
  height: 150px;
  margin: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.62);
}

.pie-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 166px;
}

.pie-legend {
  display: grid;
  gap: 8px;
  align-content: center;
}

.pie-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.customer-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(160px, 0.8fr);
  align-items: center;
  gap: 16px;
  min-height: 340px;
}

.china-map {
  width: 100%;
  max-height: 350px;
}

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

.customer-stat-grid article {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: #f4f8f7;
}

.customer-stat-grid article:nth-child(2) {
  border-color: var(--warning);
}

.customer-stat-grid article:nth-child(3) {
  border-color: var(--danger);
}

.customer-stat-grid span,
.customer-stat-grid small {
  color: var(--muted);
  font-size: 11px;
}

.customer-stat-grid strong {
  color: var(--text);
  font-size: 20px;
}

.province-shape {
  stroke: #fff;
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  transition: opacity 160ms ease;
}

.province-shape:hover {
  opacity: 0.76;
}

.province-ranking {
  display: grid;
  max-height: 360px;
  gap: 4px;
  overflow: auto;
}

.province-ranking > strong {
  margin-bottom: 4px;
  color: var(--text);
}

.province-ranking > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.province-ranking span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.province-ranking i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.province-ranking b {
  color: var(--primary);
}

.dashboard-ranking-wrap {
  min-width: 0;
  max-height: 430px;
  overflow: auto;
}

.dashboard-ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dashboard-ranking-table th,
.dashboard-ranking-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dashboard-ranking-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8f7;
  color: var(--muted);
}

.dashboard-ranking-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.rank-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e2f0ed;
  color: var(--primary);
}

.customer-name-cell {
  min-width: 230px;
  line-height: 1.55;
}

.project-stage-chart {
  min-height: 430px;
  padding: 28px 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.project-stage-plot {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.project-stage-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--stage-count), minmax(60px, 1fr));
  gap: 4px;
  min-width: calc(var(--stage-count) * 64px);
}

.project-stage-column {
  display: grid;
  grid-template-rows: 330px 56px;
  gap: 8px;
  min-width: 0;
}

.project-stage-bar-area {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.project-stage-bar {
  display: block;
  width: calc(100% - 4px);
  height: var(--bar-height);
  min-height: 10px;
  border-radius: 4px 4px 0 0;
  background: var(--color-primary-fixed-dim);
  transition: height 180ms ease;
}

.project-stage-column:nth-child(3n + 2) .project-stage-bar {
  background: var(--color-secondary-container);
}

.project-stage-column:nth-child(3n) .project-stage-bar {
  background: var(--color-primary-fixed);
}

.project-stage-value {
  position: absolute;
  bottom: calc(var(--bar-height) + 6px);
  color: var(--text);
  font-size: 12px;
}

.project-stage-label {
  align-self: start;
  min-width: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.todo-list,
.timeline,
.log-list {
  display: grid;
  gap: 8px;
}

.pagination {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.pagination-jump label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-jump input {
  width: 64px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
}

.pagination-jump-button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.pagination-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-size: 23px;
  line-height: 1;
}

.pagination-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.guide-intro {
  max-width: 820px;
  margin-bottom: 24px;
}

.guide-intro h2 {
  font-size: 26px;
}

.guide-intro p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  border-top: 1px solid var(--line);
}

.guide-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.guide-item > span {
  grid-row: 1 / 4;
  color: var(--accent);
  font-weight: 900;
}

.guide-item h3,
.guide-item p {
  margin: 0;
}

.guide-item p {
  color: var(--muted);
  line-height: 1.65;
}

.guide-item strong {
  margin-top: 7px;
  color: var(--primary);
  font-size: 13px;
}

.report-card {
  padding: 18px;
  color: var(--primary);
  font-weight: 800;
  text-align: left;
}

.activity-log-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f4f8f7;
}

.activity-log-summary span {
  color: var(--muted);
  font-size: 12px;
}

.employee-log-list {
  display: grid;
  max-height: 430px;
  gap: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
}

.employee-log-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

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

.employee-log-item div {
  display: grid;
  gap: 4px;
}

.employee-log-item span,
.employee-log-item time {
  color: var(--muted);
  font-size: 12px;
}

.employee-log-item time {
  flex: 0 0 auto;
}

.site-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.check-list {
  margin-bottom: 0;
  padding-left: 22px;
  line-height: 1.8;
}

.modal {
  width: min(760px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(9, 24, 27, 0.48);
}

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

.modal-header,
.modal-body,
.form-actions,
.wide {
  grid-column: 1 / -1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 18px;
  }

  .brand-row {
    margin-bottom: 14px;
  }

  .nav-list {
    display: flex;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .system-nav {
    margin-top: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

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

@media (max-width: 900px) {
  .dashboard-main-grid,
  .demo-management-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .overview-panel,
  .dashboard-todo-panel {
    min-height: 0;
  }

  .customer-map-layout {
    grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr);
  }
}

.success-toast-region {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 2200;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.operation-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 49, 74, 0.42);
  backdrop-filter: blur(2px);
}

.operation-loading-overlay.hidden {
  display: none;
}

.operation-loading-card {
  display: grid;
  width: min(360px, calc(100vw - 40px));
  justify-items: center;
  gap: 10px;
  padding: 26px 28px;
  border: 1px solid #d7e5f3;
  border-radius: 16px;
  background: #ffffff;
  color: #17314a;
  text-align: center;
  box-shadow: 0 24px 70px rgba(22, 61, 99, 0.28);
}

.operation-loading-card strong {
  font-size: 18px;
}

.operation-loading-card small {
  color: #667d92;
  line-height: 1.55;
}

.operation-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d9e8f7;
  border-top-color: #2b7dcc;
  border-radius: 50%;
  animation: operation-loading-spin 0.75s linear infinite;
}

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

body.operation-loading-active {
  cursor: progress;
}

.success-toast-region.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.success-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  padding: 13px 18px;
  border: 1px solid #b8e5c7;
  border-radius: 12px;
  background: #f0fff5;
  color: #126b34;
  box-shadow: 0 12px 34px rgba(18, 107, 52, 0.18);
}

.success-toast-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: #1f9d55;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.success-toast strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

@media (max-width: 760px) {
  .success-toast-region {
    top: 14px;
    right: 14px;
    left: 14px;
    display: flex;
    justify-content: center;
  }

  .success-toast {
    justify-content: center;
    width: min(100%, 320px);
  }
}

/* Training library folders */
.training-library-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.training-category-sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  max-height: calc(100vh - 120px);
  padding: 18px 12px 12px;
  overflow: hidden;
  border: 1px solid #dbe7f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 76, 116, 0.06);
}

.training-category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 13px;
  border-bottom: 1px solid #edf2f6;
}

.training-category-heading span {
  color: #163b5c;
  font-size: 15px;
  font-weight: 700;
}

.training-category-heading small {
  color: #8094a8;
}

.training-category-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 12px 0;
  overflow-y: auto;
}

.training-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #43627e;
  cursor: pointer;
  text-align: left;
}

.training-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  border-radius: 9px;
}

.training-category-row:hover {
  background: #f2f7fb;
}

.training-category-row .training-category-item:hover {
  background: transparent;
}

.training-category-item > span:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.training-category-item:hover {
  background: #f2f7fb;
}

.training-category-item.active,
.training-category-row.active {
  background: #e7f4ef;
  color: #126b51;
  font-weight: 700;
}

.training-category-icon {
  color: #7da0ba;
  font-size: 13px;
}

.training-category-item.active .training-category-icon,
.training-category-row.active .training-category-icon {
  color: #15906b;
}

.training-category-count {
  min-width: 25px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf3f7;
  color: #678097;
  font-size: 12px;
  text-align: center;
}

.training-category-item.active .training-category-count,
.training-category-row.active .training-category-count {
  background: #fff;
  color: #126b51;
}

.training-category-edit {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7890a5;
  cursor: pointer;
}

.training-category-edit:hover,
.training-category-row.active .training-category-edit:hover {
  background: #fff;
  color: #126b51;
}

.training-category-add {
  width: 100%;
  margin-top: auto;
}

.training-library-content {
  min-width: 0;
}

.training-library-content .action-bar {
  margin-top: 0;
}

.training-category-context {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f6;
}

.training-category-context div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.training-category-context strong {
  color: #173c5d;
  font-size: 17px;
}

.training-category-context span {
  color: #7b91a5;
  font-size: 13px;
}

.training-category-label {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf7f3;
  color: #167157;
  white-space: nowrap;
}

.empty-table-state {
  padding: 44px 16px;
  color: #8295a7;
  text-align: center;
}

@media (max-width: 980px) {
  .training-library-layout {
    grid-template-columns: 1fr;
  }

  .training-category-sidebar {
    position: static;
    display: block;
    min-height: 0;
    max-height: none;
  }

  .training-category-list {
    flex-direction: row;
    padding-bottom: 10px;
    overflow-x: auto;
  }

  .training-category-item {
    flex: 0 0 auto;
    width: auto;
    gap: 10px;
  }

  .training-category-row {
    flex: 0 0 auto;
    grid-template-columns: auto 34px;
  }

  .training-category-add {
    width: auto;
  }
}

@media (max-width: 900px) {
  .dashboard-main-grid,
  .demo-management-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .overview-panel,
  .dashboard-todo-panel {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px 12px 86px;
  }

  .topbar,
  .action-bar,
  .panel-header,
  .content-grid,
  .metric-grid,
  .report-grid,
  .modal-body,
  .modal-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-header {
    display: grid;
  }

  .user-box {
    justify-content: flex-start;
  }

  .beijing-clock {
    flex-basis: 100%;
  }

  .primary-button,
  .secondary-button,
  .search-box {
    width: 100%;
  }

  .search-box.compact-filter {
    max-width: none;
  }

  .module-grid,
  .material-home,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-terminal-actions {
    grid-template-columns: 1fr;
  }

  .filter-menu {
    width: 100%;
  }

  .filter-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .demo-detail-actions,
  .opportunity-detail-actions,
  .contract-detail-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .person-detail-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .person-permission-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .person-permission-actions .primary-button,
  .person-permission-actions .secondary-button {
    width: auto;
  }

  .permission-card-grid,
  .permission-scope-grid,
  .permission-check-grid {
    grid-template-columns: 1fr;
  }

  .person-detail-actions .primary-button,
  .person-detail-actions .secondary-button {
    width: auto;
  }

  .inventory-command-group,
  .inventory-command-group .primary-button,
  .inventory-command-group .secondary-button {
    width: 100%;
  }

  .inventory-command-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .module-tabs {
    width: 100%;
  }

  .inventory-form-grid,
  .inventory-movement-row,
  .formula-component-row,
  .composition-item {
    grid-template-columns: 1fr;
  }

  .inventory-movement-row .icon-button,
  .formula-component-row .icon-button {
    width: 100%;
    border: 1px solid var(--line);
  }

  .demo-calendar-day {
    min-height: 68px;
    padding: 5px;
  }

  .demo-booking-chip {
    padding: 3px;
    font-size: 10px;
  }

  .public-pool-claim-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .panel {
    padding: 14px;
  }

  .nav-list {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    padding: 8px;
    background: #123238;
    box-shadow: 0 -10px 28px rgba(9, 24, 27, 0.18);
  }

  .nav-item {
    min-width: 84px;
    padding: 0 10px;
    text-align: center;
  }

  .bar-row,
  .summary-line {
    grid-template-columns: 1fr;
  }

  .date-range-controls,
  .trend-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .business-overview,
  .project-stage-chart {
    min-height: 340px;
  }

  .customer-map-layout,
  .pie-layout {
    grid-template-columns: 1fr;
  }

  .customer-stat-grid {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    margin: 0 auto;
  }

  .province-ranking {
    max-height: 160px;
  }

  .project-stage-chart {
    padding-top: 20px;
  }

  .project-stage-column {
    height: auto;
  }

  .project-stage-column {
    grid-template-rows: 250px 56px;
  }

  .contact-summary,
  .pagination,
  .activity-log-summary,
  .employee-log-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contact-summary span {
    text-align: left;
  }

  .customer-stats-grid {
    grid-template-columns: 1fr;
  }

  .customer-contact-group-head,
  .customer-contact-inquiry-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-contact-inquiry-list {
    padding-left: 10px;
  }

  .site-footer {
    padding-bottom: 90px;
  }
}

/* Light blue CRM theme — selected 2026-07-30 */
body {
  background: #f4f9ff;
}

::selection {
  background: #cfe6ff;
  color: #0a376a;
}

.boot-screen,
.login-screen {
  background: #eff7ff;
}

.boot-card {
  border-color: #d4e6f8;
  box-shadow: 0 20px 60px rgba(36, 91, 147, 0.14);
}

.login-card {
  border-color: #d4e6f8;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(36, 91, 147, 0.14);
}

.login-card .brand-mark,
.sidebar .brand-mark {
  border-radius: 10px;
  background: #1674cf;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(31, 122, 224, 0.22);
}

input,
select,
textarea {
  border-color: #ccdeef;
  border-radius: 8px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9fc5eb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4d98e9;
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.12);
}

.app-shell {
  grid-template-columns: 226px minmax(0, 1fr);
  background: #f4f9ff;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  z-index: 30;
  padding: 20px 12px 14px;
  overflow: hidden;
  border-right: 1px solid #d6e6f6;
  background: #f7fbff;
  color: #173a5e;
  box-shadow: 4px 0 18px rgba(68, 122, 173, 0.05);
}

.sidebar .brand-row {
  min-width: 200px;
  gap: 11px;
  margin: 0 10px 24px;
}

.sidebar .brand-mark {
  width: 38px;
  height: 38px;
}

.sidebar .brand-row strong {
  color: #102a43;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.sidebar .brand-row span {
  margin-top: 2px;
  color: #70869b;
  font-size: 11px;
}

.nav-list {
  height: calc(100vh - 92px);
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  min-width: 198px;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 10px;
  color: #416585;
  font-size: 14px;
  font-weight: 700;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.nav-item i {
  width: 21px;
  flex: 0 0 21px;
  color: #4e7294;
  font-size: 21px;
  text-align: center;
}

.nav-item:hover {
  background: #edf6ff;
  color: #166cc8;
}

.nav-item:hover i {
  color: #1f7ae0;
}

.nav-item.active {
  background: #e1efff;
  color: #146fd1;
  box-shadow: inset 3px 0 0 #2b82e6;
}

.nav-item.active i {
  color: #1f7ae0;
}

.workspace {
  width: 100%;
  max-width: none;
  padding: 0 24px 32px;
  background: #f4f9ff;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 74px;
  margin: 0 -24px 76px;
  padding: 0 24px;
  border-bottom: 1px solid #d9e7f6;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 10px rgba(53, 104, 154, 0.04);
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: 18px;
}

.sidebar-toggle-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-right: 1px solid #dbe7f4;
  border-radius: 0;
  background: transparent;
  color: #345b7d;
  font-size: 22px;
}

.sidebar-toggle-button:hover {
  color: #1f7ae0;
}

.eyebrow {
  margin: 0;
  color: #365a7c;
  font-size: 14px;
  font-weight: 800;
}

.topbar h1 {
  position: absolute;
  top: 90px;
  left: 24px;
  color: #102f4f;
  font-size: 31px;
  font-weight: 900;
  letter-spacing: -0.7px;
}

.user-box {
  flex-wrap: nowrap;
  gap: 14px;
}

.sync-status {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #46627c;
  font-size: 13px;
}

.sync-status[data-status="todo"],
.sync-status[data-status="clear"] {
  padding: 6px 10px;
  border-width: 1px;
  border-style: solid;
}

.beijing-clock {
  padding-left: 16px;
  border-left: 1px solid #dce8f4;
  color: #4c6680;
  font-size: 13px;
}

.account-button {
  padding: 0 2px 0 16px;
  border: 0;
  border-left: 1px solid #dce8f4;
  background: transparent;
  color: #294c6d;
  font-size: 13px;
}

.account-button:hover {
  background: transparent;
  color: #1f7ae0;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #395976;
}

.logout-button:hover {
  color: #1f7ae0;
  background: transparent;
}

.primary-button,
.secondary-button,
.account-button,
.danger-button,
.report-card,
.chart-page-button,
.module-tab {
  border-radius: 7px;
}

.primary-button {
  background: #247de3;
  box-shadow: 0 5px 12px rgba(31, 122, 224, 0.17);
}

.primary-button:hover {
  background: #1468c7;
}

.secondary-button {
  border-color: #cfdeed;
  background: #ffffff;
  color: #355671;
}

.secondary-button:hover {
  border-color: #8ab8e5;
  background: #f2f8ff;
  color: #176fcf;
}

.metric-grid,
.content-grid,
.report-grid {
  gap: 16px;
}

#metricGrid {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid #d8e7f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(51, 107, 160, 0.08);
}

#metricGrid .metric-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 100px;
  padding: 0 22px;
  border: 0;
  border-left: 1px solid #dce8f4;
  border-radius: 0;
  box-shadow: none;
}

#metricGrid .metric-card:first-child {
  padding-left: 4px;
  border-left: 0;
}

.metric-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #eaf4ff;
  color: #247de3;
  font-size: 29px;
}

#metricGrid .metric-card:last-child .metric-icon {
  background: #fff4e5;
  color: #f59e0b;
}

.metric-copy {
  min-width: 0;
}

#metricGrid .metric-card span {
  color: #516b85;
  font-size: 14px;
}

#metricGrid .metric-card strong {
  margin: 4px 0 3px;
  color: #0e2d4d;
  font-size: 30px;
  line-height: 1.05;
}

#metricGrid .metric-card small {
  color: #71869a;
  font-size: 12px;
}

.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
  gap: 16px;
}

.metric-card,
.panel,
.report-card,
.module-card {
  border-color: #d7e6f5;
  border-radius: 13px;
  box-shadow: 0 7px 20px rgba(51, 107, 160, 0.07);
}

.panel {
  padding: 18px;
}

.overview-panel,
.dashboard-todo-panel {
  min-height: 660px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header h2,
.panel-header h3 {
  color: #173652;
}

.panel-header p {
  color: #667d93;
  line-height: 1.55;
}

.overview-header {
  align-items: flex-start;
}

.date-range-controls label {
  color: #526b83;
}

.date-range-controls input {
  border-color: #d4e2f0;
  background: #fbfdff;
}

.trend-summary {
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f8ff;
}

.trend-summary > div {
  padding: 14px 16px;
  background: #f2f8ff;
}

.trend-summary > div + div {
  border-left: 1px solid #dce9f5;
}

.payment-dot,
.payment-point {
  fill: #18c5c7;
  background: #18c5c7;
}

.payment-line {
  stroke: #18c5c7;
}

.chart-grid-line {
  stroke: #dce7f2;
}

.chart-page-button {
  min-height: 36px;
  padding: 0 20px;
  border-color: #d1dfed;
  background: #ffffff;
  color: #49647e;
}

.chart-page-button:hover,
.chart-page-button.active {
  border-color: #247de3;
  background: #247de3;
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(31, 122, 224, 0.16);
}

.dashboard-todo-panel {
  padding: 18px 16px;
}

.dashboard-todo-panel .todo-list {
  position: relative;
  max-height: 566px;
  padding-left: 30px;
}

.dashboard-todo-panel .todo-list::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 1px;
  background: #d8e5f2;
  content: "";
}

.dashboard-todo-panel .todo-scope-divider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  color: #718aa2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dashboard-todo-panel .todo-scope-divider::before,
.dashboard-todo-panel .todo-scope-divider::after {
  height: 1px;
  flex: 1;
  background: #d8e5f2;
  content: "";
}

.dashboard-todo-panel .todo-scope-divider span {
  flex: 0 0 auto;
}

.dashboard-todo-panel .todo-item {
  position: relative;
  margin-top: 10px;
  padding: 13px 34px 13px 14px;
  border-color: #d7e4f1;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(51, 107, 160, 0.04);
}

.dashboard-todo-panel .todo-status-icon {
  position: absolute;
  top: 15px;
  left: -31px;
  z-index: 1;
  width: 23px;
  background: #ffffff;
  color: #2a82e6;
  font-size: 22px;
  text-align: center;
}

.dashboard-todo-panel .urgent-todo {
  border-color: #f6c6bd;
  background: #fffdfc;
}

.dashboard-todo-panel .urgent-todo .todo-status-icon {
  color: #e74425;
}

.todo-item .todo-kind {
  color: #e58700;
}

.todo-button:hover {
  border-color: #86b8e8;
  background: #f8fbff;
}

.action-bar {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(51, 107, 160, 0.05);
}

.filter-popover {
  border-color: #d3e2f1;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(35, 79, 123, 0.18);
}

.module-tabs {
  padding: 4px;
  border-color: #d7e4f1;
  border-radius: 10px;
  background: #edf6ff;
}

.module-tab {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #57718a;
}

.module-tab.active {
  background: #ffffff;
  color: #176fcf;
  box-shadow: 0 3px 9px rgba(45, 101, 154, 0.11);
}

.module-card:hover {
  border-color: #80b4e7;
  background: #f4f9ff;
}

.inventory-value-summary {
  border-color: #cce1f5;
  background: #eef7ff;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #e0eaf4;
  border-radius: 10px;
  overscroll-behavior-inline: contain;
}

#productLibraryView table,
#demoUnitsView table {
  min-width: 1040px;
}

.competitor-company-table {
  min-width: 1320px;
}

#productLibraryView th:nth-child(2),
#productLibraryView td:nth-child(2) {
  min-width: 210px;
}

#productLibraryView th:nth-child(3),
#productLibraryView td:nth-child(3),
#productLibraryView th:nth-child(4),
#productLibraryView td:nth-child(4) {
  min-width: 130px;
}

.competitor-company-table th,
.competitor-company-table td {
  min-width: 150px;
}

.competitor-company-table th:first-child,
.competitor-company-table td:first-child {
  min-width: 260px;
}

@media (min-width: 1181px) and (max-width: 1380px) {
  .workspace {
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .table-wrap table {
    min-width: max(980px, 100%);
  }

  #metricGrid .metric-card {
    min-height: 88px;
    padding: 12px 18px;
  }

  #metricGrid .metric-card:nth-child(3) {
    border-top: 1px solid #dce8f4;
    border-left: 0;
  }

  #metricGrid .metric-card:nth-child(4) {
    border-top: 1px solid #dce8f4;
  }
}

th,
td {
  padding: 13px 12px;
  border-bottom-color: #e2ebf4;
}

th {
  background: #f6faff;
  color: #4c6882;
}

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

tr[data-open-customer]:hover,
tr[data-open-person]:hover,
tr[data-open-product]:hover,
tr[data-open-contract]:hover,
tr[data-open-payment]:hover,
tr[data-open-tender]:hover,
tr[data-open-training]:hover,
tr[data-open-demo]:hover,
tr[data-open-demo-booking]:hover,
tr[data-open-inventory-item]:hover,
tr[data-open-inventory-record]:hover,
tr[data-open-opportunity]:hover,
.selected-row {
  background: #eff7ff;
}

.table-thumbnail {
  border-color: #cfe0f1;
  border-radius: 9px;
  background: #edf6ff;
}

.status-pill {
  background: #fff2de;
  color: #b96a00;
}

.muted-pill {
  background: #edf2f7;
  color: #587086;
}

.available-pill {
  background: #e3f8ed;
  color: #168451;
}

.reservation-pill {
  background: #e9f2ff;
  color: #246fc4;
}

.warning-pill {
  background: #fff4df;
  color: #af6800;
}

.settlement-type-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin-top: 7px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.receivable-type-pill {
  background: #e3f8ed;
  color: #168451;
}

.payable-type-pill {
  background: #efe8ff;
  color: #6d3fc0;
}

.mini-card,
.payment-item,
.timeline-item,
.log-item,
.todo-item {
  border-color: #dce8f4;
  border-radius: 9px;
  background: #fbfdff;
}

.mini-card-button:hover,
.selected-card {
  border-color: #7cb2e5;
  background: #eff7ff;
}

.pagination-button {
  border-color: #cfddec;
  color: #1f7ae0;
}

.pagination-button:not(:disabled):hover {
  border-color: #79ade0;
  background: #eef7ff;
}

.modal {
  border: 1px solid #d7e5f3;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(22, 61, 99, 0.22);
}

.modal::backdrop {
  background: rgba(24, 53, 82, 0.46);
}

.site-footer {
  border-top-color: #dce7f2;
  background: #f7fbff;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar .brand-row {
  min-width: 0;
  margin-inline: 7px;
}

.app-shell.sidebar-collapsed .sidebar .brand-row > div:last-child,
.app-shell.sidebar-collapsed .nav-item span {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item {
  min-width: 50px;
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .nav-item i {
  flex-basis: 24px;
  width: 24px;
}

@media (max-width: 1180px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid #d6e6f6;
  }

  .sidebar .brand-row,
  .app-shell.sidebar-collapsed .sidebar .brand-row {
    margin: 0 0 12px;
  }

  .nav-list {
    height: auto;
    flex-direction: row;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    min-width: auto;
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 0 13px;
  }

  .app-shell.sidebar-collapsed .sidebar .brand-row > div:last-child,
  .app-shell.sidebar-collapsed .nav-item span {
    display: block;
  }

  .sidebar-toggle-button {
    display: none;
  }

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

  #metricGrid .metric-card:nth-child(3) {
    padding-left: 4px;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 0 12px 86px;
  }

  .topbar {
    display: grid;
    min-height: 0;
    margin: 0 -12px 24px;
    padding: 12px;
  }

  .topbar h1 {
    position: static;
    margin-top: 18px;
    font-size: 27px;
  }

  .topbar-heading {
    display: block;
    width: 100%;
  }

  .user-box {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sync-status,
  .topbar-refresh-button,
  .beijing-clock,
  .account-button,
  .logout-button {
    min-height: 30px;
    padding: 0;
    border: 0;
  }

  .beijing-clock {
    grid-column: 1 / -1;
    white-space: normal;
  }

  #metricGrid {
    grid-template-columns: 1fr;
    padding: 6px 16px;
  }

  #metricGrid .metric-card,
  #metricGrid .metric-card:nth-child(3) {
    min-height: 86px;
    padding: 10px 0;
    border-top: 1px solid #dce8f4;
    border-left: 0;
  }

  #metricGrid .metric-card:first-child {
    border-top: 0;
  }

  .metric-icon {
    width: 52px;
    height: 52px;
  }

  .panel,
  .action-bar {
    padding: 14px;
  }

  .dashboard-todo-panel .todo-list {
    padding-left: 28px;
  }

  .nav-list {
    max-width: 100vw;
    border-top: 1px solid #cfe0f1;
    background: #f7fbff;
    box-shadow: 0 -8px 24px rgba(37, 83, 128, 0.14);
  }

  .nav-item {
    color: #63809b;
  }

  .nav-item.active {
    background: #e2efff;
    color: #176fcf;
  }
}

@media (max-width: 900px) {
  .dashboard-main-grid,
  .demo-management-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .overview-panel,
  .dashboard-todo-panel {
    min-height: 0;
  }
}
.table-date-stack {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
  white-space: nowrap;
}

.table-date-stack small {
  color: var(--muted);
  font-size: 12px;
}
