:root {
  --primary: #165dff;
  --primary-weak: #e8f3ff;
  --success: #00b42a;
  --warning: #ff7d00;
  --danger: #f53f3f;
  --text: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --bg: #f2f3f5;
  --card: #ffffff;
  --sider: #ffffff;
  --radius: 6px;
  --shadow: 0 8px 24px rgba(29, 33, 41, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

a,
button,
input,
select,
textarea,
.nav-item,
.top-title,
.table-toolbar,
.arco-card {
  color: var(--text);
}

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

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

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

.sider {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--sider);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  width: 232px;
}

.sider-brand,
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sider-brand {
  padding: 6px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark,
.login-logo span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #165dff, #14c9c9);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.sider-brand strong,
.login-logo strong {
  display: block;
  font-size: 16px;
}

.sider-brand small,
.login-logo small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 3px;
  padding-top: 14px;
}

.nav-group {
  margin: 12px 10px 5px;
  color: #a9aeb8;
  font-size: 12px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #4e5969 !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  text-align: left;
}

.nav-item:hover {
  background: #f7f8fa;
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-weak);
  color: var(--primary) !important;
  font-weight: 600;
}

.nav-icon {
  width: 22px;
  color: inherit;
  text-align: center;
}

.main {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
}

.top-title h1 {
  font-size: 22px;
  line-height: 1.3;
}

.top-title p,
.table-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  width: 260px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8fa;
  color: var(--muted);
}

.search-box input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  background: transparent;
}

.arco-btn {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #4e5969;
  cursor: pointer;
  padding: 0 14px;
}

.arco-btn:hover {
  color: var(--primary);
  border-color: #94bfff;
}

.arco-btn-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.arco-btn-primary:hover {
  color: #fff;
  background: #0e42d2;
}

.section {
  display: none;
  padding: 22px 24px 30px;
  min-height: calc(100vh - 72px);
}

.section.active {
  display: block;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.workspace-head h2 {
  margin-top: 5px;
  font-size: 24px;
}

.date-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 13px;
}

.arco-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.arco-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-height: 116px;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--primary-weak);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

.card-head,
.table-toolbar,
.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-head {
  padding: 16px 16px 0;
}

.card-head h3 {
  font-size: 16px;
}

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

.trend-board,
.todo-list,
.list,
.mini-bars,
.risk-list {
  padding: 16px;
}

.trend-board {
  height: 230px;
  display: flex;
  align-items: end;
  gap: 12px;
}

.trend-item {
  flex: 1;
  min-width: 0;
  display: grid;
  align-content: end;
  gap: 8px;
  height: 100%;
}

.trend-bar {
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #165dff, #14c9c9);
}

.trend-item small {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-list,
.list,
.mini-bars,
.risk-list {
  display: grid;
  gap: 10px;
}

.todo-item,
.list-item,
.risk-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.list-item strong,
.todo-item strong {
  font-size: 14px;
}

.list-item small,
.todo-item small,
.risk-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
}

.badge.red {
  background: #ffece8;
  color: var(--danger);
}

.badge.amber {
  background: #fff7e8;
  color: var(--warning);
}

.bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #f2f3f5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #14c9c9);
}

.table-card {
  padding: 0;
}

.table-toolbar {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar h2 {
  font-size: 18px;
}

.toolbar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-toolbar-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.module-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar-tags span {
  border-radius: 999px;
  background: #f2f3f5;
  color: #4e5969;
  padding: 5px 10px;
  font-size: 12px;
}

.table-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.table-filters.empty {
  display: none;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field span,
.form-field small {
  color: var(--muted);
  font-size: 12px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: 0;
  padding: 0 10px;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.12);
}

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

.arco-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.arco-table th,
.arco-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.arco-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #4e5969;
  background: #f7f8fa;
  font-weight: 600;
}

.arco-table tr:hover td {
  background: #fbfcff;
}

.empty-table {
  height: 160px;
  color: var(--muted);
  text-align: center !important;
  vertical-align: middle !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}

.small {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #4e5969;
  cursor: pointer;
  padding: 0 9px;
  font-size: 12px;
}

.small:hover {
  color: var(--primary);
  border-color: #94bfff;
}

.small.danger {
  color: var(--danger);
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(29, 33, 41, 0.45);
}

.dialog-form {
  padding: 0;
}

.dialog-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: #f2f3f5;
  cursor: pointer;
}

#formFields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
}

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

.form-field.wide {
  grid-column: 1 / -1;
}

.form-field label {
  color: #4e5969;
  font-size: 13px;
}

.arco-input,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
}

.form-field textarea {
  min-height: 92px;
  resize: vertical;
}

.dialog-actions {
  padding: 14px 20px 18px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.login-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f2f6ff, #eef8f7);
  padding: 20px;
}

.login-layer.active {
  display: flex;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #4e5969;
}

.login-card p {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.cockpit {
  min-height: calc(100vh - 116px);
  border-radius: 10px;
  overflow: hidden;
  padding: 22px;
  color: #dff7ff;
  background:
    linear-gradient(rgba(10, 29, 61, 0.78), rgba(5, 16, 36, 0.92)),
    radial-gradient(circle at 20% 18%, rgba(22, 93, 255, 0.35), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(20, 201, 201, 0.25), transparent 30%),
    #061225;
}

.cockpit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cockpit-header span,
.cockpit-time {
  color: #7ee7ff;
  font-size: 13px;
}

.cockpit-header h2 {
  margin-top: 7px;
  font-size: 34px;
  color: #fff;
}

.cockpit-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.cockpit-kpi,
.cockpit-panel {
  border: 1px solid rgba(126, 231, 255, 0.22);
  background: linear-gradient(180deg, rgba(17, 55, 103, 0.72), rgba(8, 24, 52, 0.72));
  border-radius: 8px;
  box-shadow: 0 0 28px rgba(22, 93, 255, 0.12) inset;
}

.cockpit-kpi {
  padding: 15px;
}

.cockpit-kpi span {
  color: #9fdff1;
  font-size: 12px;
}

.cockpit-kpi strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: 28px;
}

.cockpit-layout {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 14px;
}

.cockpit-panel {
  min-height: 250px;
  padding: 16px;
}

.cockpit-panel h3 {
  color: #fff;
  font-size: 16px;
}

.cockpit-center {
  grid-row: span 2;
  min-height: 514px;
}

.hub {
  position: relative;
  height: 320px;
  display: grid;
  place-items: center;
}

.hub-ring {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 1px solid rgba(126, 231, 255, 0.35);
  box-shadow: 0 0 70px rgba(22, 93, 255, 0.24), inset 0 0 50px rgba(20, 201, 201, 0.18);
}

.hub-ring::before,
.hub-ring::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  border: 1px dashed rgba(126, 231, 255, 0.35);
}

.hub-ring::after {
  inset: 68px;
  border-style: solid;
}

.hub-core {
  position: relative;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: radial-gradient(circle, rgba(20, 201, 201, 0.35), rgba(22, 93, 255, 0.22));
}

.hub-core strong {
  color: #fff;
  font-size: 44px;
}

.hub-core span {
  color: #b9effb;
  font-size: 12px;
}

.flow-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.flow-line span,
.radar-item {
  border: 1px solid rgba(126, 231, 255, 0.18);
  border-radius: 6px;
  background: rgba(126, 231, 255, 0.06);
  color: #dff7ff;
  padding: 9px;
  text-align: center;
  font-size: 12px;
}

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

.radar-item strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 25px;
}

.dark.trend-board {
  height: 190px;
  padding: 18px 0 0;
}

.dark .trend-bar {
  background: linear-gradient(180deg, #7ee7ff, #165dff);
}

.cockpit .bar-track {
  background: rgba(255, 255, 255, 0.12);
}

.cockpit .bar-row {
  color: #dff7ff;
}

.risk-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(126, 231, 255, 0.18);
}

.risk-item small {
  color: #9fdff1;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .sider {
    position: sticky;
    height: 100vh;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .arco-grid,
  .cockpit-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid,
  .cockpit-layout,
  .table-filters {
    grid-template-columns: 1fr;
  }

  .span-2,
  .cockpit-center {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .topbar,
  .top-actions,
  .workspace-head,
  .table-toolbar,
  .table-toolbar-side,
  .cockpit-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-toolbar-side {
    justify-items: start;
  }

  .module-tools {
    justify-content: flex-start;
  }

  .section {
    padding: 16px;
  }

  .search-box {
    width: 100%;
  }

  .arco-grid,
  .cockpit-kpis,
  #formFields,
  .table-filters,
  nav {
    grid-template-columns: 1fr;
  }
}
