:root {
  --ink: #172033;
  --muted: #73809a;
  --line: #e8ecf3;
  --page: #f6f8fc;
  --panel: #fff;
  --brand: #4659d7;
  --brand-soft: #eef0ff;
  --green: #138a66;
  --green-soft: #e8f8f2;
  --red: #cf3d4b;
  --red-soft: #fff0f1;
  --shadow: 0 10px 30px rgba(24, 37, 74, 0.06);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font:
    14px/1.5 Inter,
    "Noto Sans SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 19px;
  font-weight: 760;
}
.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #7182ff, #4659d7);
  box-shadow: 0 8px 20px #0d1532;
}
.mark:before {
  content: "↗";
  font-size: 20px;
  font-weight: 900;
}
.login {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.88fr);
}
.login-art {
  padding: 46px 7vw;
  background: #18223e;
  color: #c6cce0;
}
.login-art h1 {
  max-width: 520px;
  margin: 14vh 0 15px;
  color: #fff;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -1.4px;
}
.login-art p {
  max-width: 450px;
  color: #b7c0d9;
  font-size: 16px;
}
.login-points {
  display: grid;
  gap: 14px;
  margin-top: 42px;
}
.login-points div {
  padding: 14px 16px;
  border: 1px solid #334160;
  border-radius: 12px;
  background: #202c4d;
}
.login-points b {
  display: block;
  color: #fff;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
}
.form-wrap {
  width: min(100%, 390px);
}
.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
}
.eyebrow:before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}
.form-wrap h2 {
  margin: 14px 0 7px;
  font-size: 27px;
  letter-spacing: -0.6px;
}
.form-wrap > p {
  margin: 0 0 28px;
  color: var(--muted);
}
.field {
  margin-bottom: 17px;
}
.field label {
  display: block;
  margin-bottom: 7px;
  color: #44506a;
  font-size: 13px;
  font-weight: 700;
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dfe4ed;
  border-radius: 9px;
  outline: 0;
  font: inherit;
}
.field input:focus {
  border-color: #7583ec;
  box-shadow: 0 0 0 3px rgba(70, 89, 215, 0.12);
}
.button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 12px 17px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgba(70, 89, 215, 0.2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #f3c8cc;
  border-radius: 10px;
  background: var(--red-soft);
  color: #9f2633;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  padding: 24px 14px;
  background: #18223e;
  color: #c6cce0;
}
.nav-label {
  margin: 28px 12px 7px;
  color: #7f8ba8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #bdc6df;
  text-decoration: none;
}
.nav.active {
  background: #2e3b61;
  color: #fff;
  box-shadow: inset 3px 0 #8290ff;
}
.nav.disabled {
  opacity: 0.5;
}
.side-note {
  margin: 30px 8px;
  padding: 14px;
  border: 1px solid #344264;
  border-radius: 12px;
  background: #202c4d;
  color: #acb6d1;
  font-size: 12px;
}
.side-note b {
  display: block;
  color: #fff;
}
.main {
  min-width: 0;
}
.topbar {
  height: 72px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}
.crumb {
  color: var(--muted);
  font-size: 13px;
}
.crumb b {
  color: var(--ink);
}
.crumb a {
  color: inherit;
  text-decoration: none;
}
.crumb a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f4c7a4;
  color: #6c341b;
  font-weight: 700;
}
.logout {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.content {
  max-width: 1480px;
  margin: auto;
  padding: 32px 36px;
}
.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 27px;
}
.heading h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.7px;
}
.heading p {
  margin: 0;
  color: var(--muted);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.metric {
  padding: 19px;
}
.metric-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}
.metric strong {
  display: block;
  margin: 15px 0 3px;
  font-size: 26px;
  letter-spacing: -0.8px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 20px 0;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
}
.panel-head span {
  color: var(--muted);
  font-size: 12px;
}
.chart {
  padding: 20px;
}
.bar {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 180px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.bar i {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(#7182ff, #4659d7);
}
.health {
  padding: 10px 20px 20px;
}
.health-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.health-row:last-child {
  border: 0;
}
.health-row div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}
.progress {
  height: 7px;
  border-radius: 8px;
  background: #edf0f5;
  overflow: hidden;
}
.progress b {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--green);
}
.notice {
  margin: 18px 20px;
  padding: 14px;
  border-radius: 10px;
  background: #f7f8fb;
  color: #586682;
}
@media (max-width: 1000px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    display: none;
  }
  .shell {
    grid-template-columns: 74px 1fr;
  }
  .sidebar {
    padding: 18px 10px;
  }
  .sidebar .brand span:last-child,
  .nav-label,
  .nav span,
  .side-note {
    display: none;
  }
  .nav {
    justify-content: center;
  }
  .topbar,
  .content {
    padding-left: 22px;
    padding-right: 22px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 24px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .metrics,
  .grid {
    grid-template-columns: 1fr;
  }
  .heading {
    align-items: start;
    flex-direction: column;
  }
  .login-form {
    padding: 24px;
  }
}

/* TASK-012 reference-dashboard layout */
.dashboard {
  max-width: none;
  padding: 16px 18px 28px;
}
.dashboard-heading {
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 12px rgba(24, 37, 74, 0.04);
}
.dashboard-heading h1 {
  font-size: 20px;
}
.dashboard-heading h1 span {
  color: #0ea5e9;
}
.range-filter {
  align-items: end;
}
.range-filter label {
  color: var(--ink);
}
.range-refresh {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: #0ea5e9;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dashboard-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.dashboard .metric {
  position: relative;
  min-height: 106px;
  overflow: hidden;
  padding: 17px 16px;
}
.dashboard .metric::after {
  position: absolute;
  right: -23px;
  bottom: -37px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  content: "";
}
.dashboard .metric strong {
  margin-top: 5px;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}
.metric-sky::after {
  background: #d8f0fc;
}
.metric-violet::after {
  background: #e9e3ff;
}
.metric-mint::after {
  background: #d9f8f0;
}
.metric-amber::after {
  background: #fff0d8;
}
.metric-indigo::after {
  background: #e5e8f7;
}
.metric-rose::after {
  background: #fde3e9;
}
.business-overview {
  margin-top: 16px;
  padding-bottom: 10px;
}
.business-overview .panel-head {
  padding: 10px 12px 7px;
}
.business-overview .panel-head h2 {
  color: var(--ink);
}
.business-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0 12px;
}
.business-stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dce5f2;
  border-radius: 6px;
  background: #f8fafc;
}
.business-stats dt {
  color: #42618a;
  font-size: 12px;
}
.business-stats dd {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dashboard-primary-grid {
  grid-template-columns: minmax(0, 2fr) minmax(380px, 1fr);
}
.chart-card .panel-head h2,
.ranking-card .panel-head h2,
.distribution-card .panel-head h2,
.recent-card .panel-head h2 {
  font-size: 17px;
}
.trend-figure svg {
  min-height: 290px;
}
.trend-total {
  stroke: #0ea5e9;
  stroke-width: 3.5;
}
.legend-total {
  background: #0ea5e9;
}
.ranking-card {
  max-height: 425px;
  overflow: auto;
}
.ranking-list {
  margin-top: 8px;
}
.ranking-list li {
  grid-template-columns: 26px minmax(0, 1fr) 56px;
  padding: 8px 0;
}
.ranking-list li > span > b,
.ranking-list li > span > small,
.ranking-list li > b,
.ranking-list li > b > small {
  display: block;
}
.ranking-list li > span > small,
.ranking-list li > b > small {
  margin-top: 1px;
  color: #42618a;
  font-size: 11px;
  font-weight: 400;
}
.ranking-list li > b {
  text-align: right;
}
.distribution-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.distribution-card {
  min-height: 286px;
}
.distribution-chart {
  height: 196px;
}
.action-list {
  display: grid;
  gap: 8px;
  margin: 18px 20px;
  padding: 0;
  list-style: none;
}
.action-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: linear-gradient(90deg, #e0f2fe, #f8fafc);
}
.action-list b {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1320px) {
  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .business-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .dashboard-primary-grid,
  .distribution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-card {
    grid-column: 1 / -1;
  }
}
@media (max-width: 680px) {
  .dashboard {
    padding: 12px;
  }
  .dashboard-metrics,
  .business-stats,
  .dashboard-primary-grid,
  .distribution-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-heading {
    align-items: stretch;
  }
  .range-filter {
    align-items: stretch;
  }
  .range-filter select,
  .range-refresh {
    width: 100%;
  }
  .chart-card {
    grid-column: auto;
  }
}
/* 左侧导航固定在视窗内，内容过长时仅导航区域滚动。 */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 680px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    height: 100vh;
    padding: 18px 14px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }
  .sidebar.drawer-open {
    transform: translateX(0);
  }
  .content {
    padding: 24px 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .metrics,
  .grid {
    grid-template-columns: 1fr;
  }
  .heading {
    align-items: start;
    flex-direction: column;
  }
  .login-form {
    padding: 24px;
  }
  .mobile-menu-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 20px;
    z-index: 25;
    box-shadow: 0 6px 14px rgba(24, 37, 74, 0.2);
    cursor: pointer;
  }
  .mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12, 20, 39, 0.35);
    z-index: 29;
  }
  .mobile-menu-backdrop.show {
    display: block;
  }
}
@media (min-width: 681px) {
  .mobile-menu-toggle,
  .mobile-menu-backdrop {
    display: none;
  }
}
@media (max-width: 680px) {
  .sidebar.drawer-open .brand span:last-child,
  .sidebar.drawer-open .nav-label,
  .sidebar.drawer-open .nav span {
    display: block;
  }
  .sidebar.drawer-open .nav {
    justify-content: flex-start;
  }
}
/* 系统设置表单布局 */
.form-section {
  padding: 0 20px 6px;
  margin-bottom: 18px;
}
.form-section .panel-head {
  padding: 20px 0 15px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.form-section .panel-head h2 {
  font-size: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.form-grid .field {
  min-width: 0;
}
.field select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #dfe4ed;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.form-actions .button {
  width: auto;
  min-width: 150px;
}
.success {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #b9ead8;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}

/* 运维列表与用户管理 */
.operations-toolbar,
.operations-pagination,
.operations-actions,
.operations-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.operations-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}
.operations-toolbar .button,
.operations-actions .button,
.operations-pagination .button {
  width: auto;
}
.operations-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 20px;
  margin-bottom: 18px;
}
.operations-filters .field {
  margin: 0;
}
.operations-filters .field:has(#result) {
  display: none;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 10px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.permission-grid legend {
  padding: 0 6px;
  font-weight: 700;
}
.permission-grid small {
  position: absolute;
  z-index: 3;
  max-width: 260px;
  margin: 6px 0 0 24px;
  padding: 7px 9px;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  background: #243044;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgb(20 31 48 / 20%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}
.permission-grid .confirm-field {
  position: relative;
  min-height: 22px;
  padding: 2px 0;
  white-space: nowrap;
}
.permission-grid .confirm-field:hover small,
.permission-grid .confirm-field:focus-within small {
  opacity: 1;
  transform: translateY(0);
}

.topbar .user {
  display: none;
}
.global-user-actions {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.profile-link:hover {
  color: var(--primary);
}
.global-user-actions .avatar {
  width: 34px;
  height: 34px;
}
.global-user-actions form {
  margin: 0;
}
@media (max-width: 680px) {
  .global-user-actions {
    top: 14px;
    right: 16px;
    gap: 8px;
  }
  .profile-link > span:last-child {
    display: none;
  }
}
.operations-filters .field input,
.operations-filters .field select {
  box-sizing: border-box;
}
.operations-filters .field-wide {
  grid-column: span 2;
}
.operations-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.operations-table td {
  vertical-align: top;
}
.operations-table .context {
  color: var(--muted);
  font-size: 12px;
}
.operations-status {
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.operations-status b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.operations-pagination {
  justify-content: flex-end;
  margin-top: 16px;
}
.operations-pagination .button[aria-current="page"] {
  background: #26387c;
}
.operations-pagination .button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.48;
}
.user-role-list {
  display: grid;
  gap: 5px;
}
.user-role-list span {
  color: var(--muted);
  font-size: 12px;
}
.danger-notice {
  border-color: #f0c4c9;
  background: #fff5f6;
  color: #9f2633;
}
.confirm-field {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 18px;
  color: #44506a;
  font-size: 13px;
  line-height: 1.45;
}
.confirm-field input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}
@media (max-width: 920px) {
  .operations-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .operations-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .operations-toolbar .button {
    width: 100%;
  }
  .operations-filters {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .operations-filters .field-wide {
    grid-column: auto;
  }
  .operations-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .operations-actions .button {
    width: 100%;
  }
}
@media (max-width: 680px) {
  .form-section {
    padding: 0 16px 4px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .form-actions .button {
    width: 100%;
  }
}
.field-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.encryption-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.encryption-settings {
  display: grid;
  gap: 20px;
}
.encryption-operations {
  display: grid;
  gap: 18px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.encryption-operations > div > label {
  display: block;
  margin: 0 0 7px;
  color: #44506a;
  font-size: 13px;
  font-weight: 700;
}
.encryption-layout .button {
  width: 100%;
  margin-top: 1px;
}
.batch-progress {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fc;
  color: var(--muted);
  font-size: 12px;
}
.batch-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.batch-progress progress {
  display: block;
  width: 100%;
  height: 7px;
  accent-color: var(--brand);
}
.batch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.batch-actions .button {
  width: 100%;
  margin-top: 0;
}
.batch-actions .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 1180px) {
  .encryption-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .encryption-operations {
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
@media (max-width: 680px) {
  .batch-actions {
    grid-template-columns: 1fr;
  }
}
.batch-actions .button[aria-busy="true"] {
  position: relative;
  cursor: wait;
  opacity: 0.75;
}
.batch-actions .button[aria-busy="true"]::after {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  content: "";
  animation: operation-spin 0.8s linear infinite;
}
.operation-modal[hidden] {
  display: none;
}
.operation-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 29, 56, 0.42);
  backdrop-filter: blur(2px);
}
.operation-modal-card {
  width: min(100%, 380px);
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(24, 37, 74, 0.2);
  text-align: center;
}
.operation-modal-card h2 {
  margin: 12px 0 6px;
  font-size: 17px;
}
.operation-modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.operation-modal-card progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: var(--brand);
}
.operation-spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid #dfe4ff;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: operation-spin 0.8s linear infinite;
}
@keyframes operation-spin {
  to {
    transform: rotate(360deg);
  }
}
.operation-pending {
  overflow: hidden;
}
.operation-result-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}
.operation-result-icon.has-work {
  background: #fff4df;
  color: #c47700;
}
.operation-result-icon.no-work {
  background: var(--green-soft);
  color: var(--green);
}
.operation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}
.operation-summary div {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fc;
}
.operation-summary b,
.operation-summary span {
  display: block;
}
.operation-summary b {
  font-size: 20px;
}
.operation-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-inline input {
  min-width: 0;
  flex: 1;
}
.field-inline input[readonly] {
  background: #f7f8fc;
  color: #596680;
  cursor: not-allowed;
}
.field-inline .button {
  width: auto;
  min-height: 44px;
  white-space: nowrap;
  padding: 0 14px;
}
.button-secondary {
  border: 1px solid #d6dcff;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.button-secondary:hover {
  border-color: #aeb8ff;
  background: #e3e7ff;
}
.button-secondary.is-editing {
  border-color: #f1c7cc;
  background: var(--red-soft);
  color: var(--red);
}
.button-secondary.is-editing:hover {
  background: #ffe4e7;
}
@media (max-width: 680px) {
  .field-inline {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .field-inline .button {
    width: 100%;
  }
}
.sidebar {
  flex-direction: column;
}

/* Dashboard operational analytics */
.dashboard-heading {
  gap: 20px;
}
.range-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.range-filter select {
  min-height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid #dfe4ed;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.dashboard-primary-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, 0.9fr);
}
.chart-card .panel-head,
.distribution-card .panel-head,
.recent-card .panel-head {
  align-items: flex-start;
  gap: 12px;
}
.panel-head > div span {
  display: block;
  margin-top: 3px;
}
.chart-legend {
  white-space: nowrap;
}
.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 4px 0 10px;
  border-radius: 50%;
}
.legend-total {
  background: var(--brand);
}
.legend-success {
  background: var(--green);
}
.trend-figure {
  margin: 8px 20px 18px;
}
.trend-figure svg {
  display: block;
  width: 100%;
  min-height: 200px;
  overflow: visible;
}
.trend-figure text {
  fill: var(--muted);
  font:
    11px system-ui,
    sans-serif;
}
.trend-axis {
  stroke: #dfe4ed;
}
.trend-total {
  fill: none;
  stroke: var(--brand);
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 3;
}
.trend-success-line {
  fill: none;
  stroke: var(--green);
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 3;
}
.trend-success {
  fill: var(--green);
}
.trend-figure figcaption {
  color: var(--muted);
  font-size: 12px;
}
.app-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 14px 20px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.app-summary div {
  padding: 12px;
}
.app-summary div + div {
  border-left: 1px solid var(--line);
}
.app-summary dt {
  color: var(--muted);
  font-size: 12px;
}
.app-summary dd {
  margin: 3px 0 0;
  font-size: 19px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}
.ranking-list {
  margin: 12px 20px 18px;
  padding: 0;
  list-style: none;
}
.ranking-list {
  counter-reset: ranking;
}
.ranking-list li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.ranking-list li::before {
  color: var(--muted);
  content: counter(ranking);
  counter-increment: ranking;
  font-variant-numeric: tabular-nums;
}
.ranking-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-list b {
  font-variant-numeric: tabular-nums;
}
.distribution-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.distribution-chart {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 190px;
  margin: 16px 20px 18px;
  padding: 0 0 0 2px;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.distribution-chart li {
  display: grid;
  min-width: 0;
  flex: 1;
  grid-template-rows: 18px 126px 28px;
  align-items: end;
  text-align: center;
}
.distribution-value {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.distribution-chart i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(#7182ff, #4659d7);
}
.distribution-label {
  overflow: hidden;
  padding-top: 6px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-card {
  margin-top: 18px;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}
.table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}
.table-wrap th,
.table-wrap td {
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
}
.table-wrap th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.table-wrap td {
  max-width: 270px;
  overflow-wrap: anywhere;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.result-cell {
  color: #44506a;
}
.empty-state {
  margin: 18px 20px;
  padding: 16px;
  border: 1px dashed #d8deeb;
  border-radius: 9px;
  background: #f8f9fc;
  color: var(--muted);
}
@media (max-width: 1120px) {
  .dashboard-primary-grid,
  .distribution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-card {
    grid-column: 1 / -1;
  }
}
@media (max-width: 680px) {
  .dashboard-heading,
  .range-filter {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-primary-grid,
  .distribution-grid {
    grid-template-columns: 1fr;
  }
  .chart-card {
    grid-column: auto;
  }
  .chart-legend {
    white-space: normal;
  }
  .trend-figure {
    margin-left: 14px;
    margin-right: 14px;
  }
  .app-summary,
  .ranking-list,
  .distribution-chart {
    margin-left: 14px;
    margin-right: 14px;
  }
  .table-wrap th,
  .table-wrap td {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Dashboard final layout overrides */
@media (min-width: 1151px) {
  .dashboard-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .business-stats {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
.business-stats a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dce5f2;
  border-radius: 6px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
}
.business-stats a:hover,
.business-stats a:focus-visible {
  border-color: #0ea5e9;
  background: #eff9ff;
  outline: 0;
}
.distribution-chart li:nth-child(6n + 1) i {
  background: linear-gradient(#13a7e8, #0b83cf);
}
.distribution-chart li:nth-child(6n + 2) i {
  background: linear-gradient(#8065e9, #6849d0);
}
.distribution-chart li:nth-child(6n + 3) i {
  background: linear-gradient(#35cfb3, #1eae91);
}
.distribution-chart li:nth-child(6n + 4) i {
  background: linear-gradient(#ffbd58, #ef9a22);
}
.distribution-chart li:nth-child(6n + 5) i {
  background: linear-gradient(#ff6682, #e84566);
}
.distribution-chart li:nth-child(6n + 6) i {
  background: linear-gradient(#6275d7, #4a5bbc);
}
.trend-figure {
  height: 330px;
}
.trend-figure canvas,
.action-card canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.action-card canvas {
  min-height: 210px;
  max-height: 250px;
  margin: 12px auto;
}
.distribution-card canvas.distribution-chart {
  display: block;
  width: calc(100% - 40px) !important;
  height: 210px !important;
  margin: 14px 20px 18px;
}
@media (max-width: 900px) {
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-heading .range-filter {
    align-items: center;
    flex-direction: row;
  }
  .dashboard-heading .range-filter label {
    white-space: nowrap;
  }
  .dashboard-heading .range-filter select {
    min-width: 0;
    flex: 1;
  }
  .dashboard-heading .range-refresh {
    width: auto;
    white-space: nowrap;
  }
}
