:root {
  color-scheme: light;
  --blue: #1767c9;
  --blue-dark: #0d4f9e;
  --blue-soft: #eaf4ff;
  --ink: #152033;
  --muted: #6e7c90;
  --line: #e1e7ef;
  --canvas: #f4f7fb;
  --card: #ffffff;
  --green: #178b66;
  --orange: #c76b18;
  --red: #c94343;
  --shadow: 0 16px 42px rgba(33, 63, 99, 0.09);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.preview-ribbon {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 20px;
  padding: 9px 14px;
  border: 1px solid rgba(23, 103, 201, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #0d58b5, #2d7ee0);
  box-shadow: 0 8px 20px rgba(23, 103, 201, 0.24);
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 4px;
  color: #8b96a6;
  font-size: 11px;
}

.nav-label {
  padding: 10px 12px 8px;
  color: #9aa5b3;
  font-size: 10px;
  letter-spacing: 0.12em;
}

#primary-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #627084;
  text-align: left;
  transition: 160ms ease;
}

.nav-item i {
  width: 20px;
  color: #8e9aac;
  font-style: normal;
  text-align: center;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.nav-item.is-active {
  font-weight: 700;
}

.nav-item.is-active i {
  color: var(--blue);
}

.sidebar-note {
  margin: auto 4px 0;
  padding: 16px;
  border: 1px solid #d7e6f7;
  border-radius: 14px;
  background: linear-gradient(155deg, #f7fbff, #edf5ff);
}

.sidebar-note span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.sidebar-note strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.sidebar-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.search-box {
  width: min(420px, 50vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  background: #f9fafc;
  color: #8d99aa;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box kbd {
  padding: 3px 6px;
  border: 1px solid #dfe5ed;
  border-radius: 5px;
  background: white;
  font-size: 10px;
}

.top-actions,
.profile-button {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 14px;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #465367;
  font-size: 20px;
}

.icon-button b {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e24f4f;
}

.profile-button {
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-button > span:first-child {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #1463bd, #3690e9);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.profile-button strong,
.profile-button small {
  display: block;
}

.profile-button strong {
  font-size: 13px;
}

.profile-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.profile-button i {
  margin-left: 5px;
  color: #8995a5;
  font-style: normal;
}

main {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 38px 38px 64px;
}

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

.page-heading > div:first-child > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.page-heading h1 {
  margin: 10px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.heading-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.table-action {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 9px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 24px rgba(23, 103, 201, 0.18);
}

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

.ghost-button,
.table-action {
  border: 1px solid #d7dee8;
  background: white;
  color: #3e4c61;
}

.demo-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #d7e8fb;
  border-radius: 11px;
  background: #f2f8ff;
  color: #51627a;
  font-size: 13px;
}

.demo-notice span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.demo-notice p {
  margin: 0;
}

#view-root {
  display: grid;
  gap: 18px;
}

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 8px 30px rgba(34, 58, 87, 0.04);
}

.metric-card {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.metric-card strong,
.metric-card span,
.metric-card small {
  display: block;
}

.metric-card strong {
  font-size: 26px;
  line-height: 1;
}

.metric-card span {
  margin-top: 7px;
  color: #5f6d81;
  font-size: 12px;
}

.metric-card small {
  margin-top: 5px;
  color: var(--green);
  font-size: 10px;
}

.panel {
  overflow: hidden;
  border-radius: 15px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf0f4;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-header a,
.text-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.chart-wrap {
  padding: 18px 22px 22px;
}

.chart-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  color: #536075;
  font-size: 12px;
}

.bar-track,
.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 99px;
  background: #edf1f6;
}

.bar-fill,
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1767c9, #43a0ef);
}

.risk-list {
  display: grid;
  gap: 0;
  padding: 8px 20px 16px;
}

.risk-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid #edf0f4;
}

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

.risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.risk-dot.red {
  background: var(--red);
}

.risk-item strong {
  display: block;
  font-size: 12px;
}

.risk-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.risk-item em {
  color: var(--orange);
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 15px 20px;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: #fafbfd;
  color: #7b8798;
  font-size: 10px;
  font-weight: 600;
}

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

.data-table strong,
.data-table small {
  display: block;
}

.data-table small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 99px;
  background: #e9f7f1;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.status.warning {
  background: #fff3e4;
  color: var(--orange);
}

.status.info {
  background: var(--blue-soft);
  color: var(--blue);
}

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

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

.feature-card {
  padding: 16px;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: #fbfcfe;
}

.feature-card span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.feature-card h3 {
  margin: 8px 0 5px;
  font-size: 14px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.ai-hero {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 30px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(125deg, #0a468e, #1767c9 58%, #318ee4);
  box-shadow: var(--shadow);
}

.ai-hero::after {
  position: absolute;
  width: 260px;
  height: 260px;
  right: -70px;
  top: -95px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.045);
  content: "";
}

.ai-hero span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  opacity: 0.75;
}

.ai-hero h2 {
  max-width: 620px;
  margin: 15px 0 10px;
  font-size: clamp(22px, 3vw, 32px);
}

.ai-hero p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.employee-preview-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eaf3ff, #f8fbff);
}

.employee-copy h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.employee-copy > p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
}

.employee-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.employee-points span {
  padding: 13px 14px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #46566c;
  font-size: 12px;
}

.phone {
  width: 330px;
  max-width: 100%;
  margin: 0 auto;
  padding: 9px;
  border: 1px solid #cfd9e5;
  border-radius: 32px;
  background: #172438;
  box-shadow: 0 24px 60px rgba(34, 63, 95, 0.25);
}

.phone-screen {
  overflow: hidden;
  min-height: 600px;
  border-radius: 24px;
  background: #f5f8fc;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 14px;
  background: #fff;
  font-size: 12px;
}

.phone-header strong {
  font-size: 15px;
}

.phone-hero {
  margin: 12px;
  padding: 22px 18px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0d4d9b, #237bd2);
}

.phone-hero small {
  opacity: 0.72;
}

.phone-hero h3 {
  margin: 12px 0 6px;
  font-size: 22px;
}

.phone-hero p {
  margin: 0;
  font-size: 11px;
  opacity: 0.8;
}

.phone-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 12px 18px;
}

.phone-stats span {
  padding: 12px 4px;
  border: 1px solid #e3e9f0;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font-size: 9px;
}

.phone-stats strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.phone-section {
  padding: 0 14px;
}

.phone-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.phone-task {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid #e2e8ef;
  border-radius: 12px;
  background: #fff;
}

.phone-task > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}

.phone-task strong,
.phone-task small {
  display: block;
}

.phone-task strong {
  font-size: 11px;
}

.phone-task small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.phone-task em {
  color: var(--blue);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.phone-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 150px;
  padding: 12px 4px 15px;
  border-top: 1px solid #e5eaf0;
  background: #fff;
  color: #7a8798;
  font-size: 8px;
  text-align: center;
}

.phone-nav span:first-child {
  color: var(--blue);
  font-weight: 800;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  padding: 11px 18px;
  border-radius: 10px;
  background: #172438;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand > span:last-child,
  .nav-label,
  .nav-item span,
  .sidebar-note {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

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

  .dashboard-grid,
  .employee-preview-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .preview-ribbon {
    right: 12px;
    bottom: 12px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    width: 100%;
    height: auto;
    display: block;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    justify-content: flex-start;
    padding: 0 0 9px;
  }

  .brand > span:last-child {
    display: block;
  }

  .brand small {
    display: none;
  }

  #primary-nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    padding: 8px 11px;
  }

  .nav-item span {
    display: block;
    font-size: 11px;
  }

  .nav-item i {
    width: auto;
  }

  .topbar {
    height: 60px;
    padding: 0 14px;
  }

  .search-box {
    width: 100%;
  }

  .search-box kbd,
  .icon-button,
  .profile-button {
    display: none;
  }

  main {
    padding: 24px 14px 56px;
  }

  .page-heading {
    display: block;
  }

  .heading-actions {
    margin-top: 18px;
  }

  .metric-grid,
  .split-grid,
  .feature-list,
  .employee-points {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 98px;
  }

  .panel {
    overflow-x: auto;
  }

  .data-table {
    min-width: 700px;
  }
}
