:root {
  --workspace-bg: #f4f7fb;
  --bg: var(--workspace-bg);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-raised: #ffffff;
  --text: #15232d;
  --muted: #6b7b88;
  --border: #dde6ee;
  --border-soft: #e8eef4;
  --green: #0c8f78;
  --green-soft: #e8f6f1;
  --blue: #246fbd;
  --blue-soft: #edf4ff;
  --amber: #b87a10;
  --amber-soft: #fff5df;
  --red: #bf3d3d;
  --red-soft: #fff0ef;
  --sidebar-bg: #14242d;
  --sidebar-bg-2: #0f1b23;
  --focus: rgba(12, 143, 120, 0.18);
  --shadow: 0 14px 30px rgba(23, 32, 38, 0.08);
  --shadow-soft: 0 8px 24px rgba(28, 43, 56, 0.06);
  --shadow-panel: 0 1px 2px rgba(15, 25, 33, 0.04), 0 10px 24px rgba(31, 44, 56, 0.05);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(12, 143, 120, 0.12), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(36, 111, 189, 0.10), transparent 30%),
    linear-gradient(135deg, #f8fbfd 0%, #eef5f8 48%, #f5f8fb 100%);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(221, 230, 238, 0.88);
  border-radius: 8px;
  box-shadow: 0 20px 46px rgba(21, 35, 45, 0.12);
  padding: 30px;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green), #67c5e8);
}

.login-panel h1 {
  margin: 24px 0 20px;
  font-size: 26px;
  line-height: 1.15;
}

.login-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 8px 0 20px;
}

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

.login-panel label {
  gap: 8px;
}

.login-panel input {
  min-height: 46px;
  padding: 10px 13px;
  background: #fbfdff;
}

.login-panel .primary {
  min-height: 46px;
  margin-top: 2px;
  font-size: 15px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #12232b;
  font-size: 18px;
}

.login-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #11a78d, #0c8f78);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(12, 143, 120, 0.22);
}

.form-error {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #f3c3bf;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  font-size: 13px;
}

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

button {
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--focus);
}

input::placeholder {
  color: #9aa7b3;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #102026;
  color: white;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: grid;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #e7fff6;
  color: #0f604f;
  border-radius: 8px;
  font-weight: 800;
}

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

.brand strong {
  font-size: 15px;
  line-height: 1.3;
}

.brand span,
.sidebar-footer span {
  color: #b7c5c9;
  font-size: 12px;
  margin-top: 4px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #d9e4e7;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
}

.nav-item svg,
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active,
.nav-item:hover {
  background: #1d363e;
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.25;
}

.topbar p,
.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.topbar-actions,
.toolbar-row,
.button-row,
.form-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-banner {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f0faf6;
  border: 1px solid #d3eee4;
  border-radius: 8px;
  color: #17483e;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(23, 32, 38, 0.03);
}

.link-banner span {
  color: var(--text);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search,
input,
select,
textarea {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  outline: none;
}

.search {
  width: min(300px, 45vw);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.primary,
.ghost,
.danger,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.primary {
  background: linear-gradient(180deg, #10a58b 0%, var(--green) 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(12, 143, 120, 0.18);
}

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

.ghost {
  background: white;
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(28, 43, 56, 0.04);
}

.danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f3c3bf;
}

.small {
  min-height: 32px;
  padding: 6px 10px;
}

.toolbar-row {
  justify-content: space-between;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 3px;
}

.segmented button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 14px;
  color: var(--muted);
}

.segmented button.active {
  background: var(--green);
  color: white;
}

.period-label {
  color: var(--muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi,
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
}

.kpi {
  min-height: 112px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

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

.kpi strong {
  font-size: 22px;
  line-height: 1.15;
}

.kpi.green {
  background: var(--green-soft);
}

.kpi.blue {
  background: var(--blue-soft);
}

.kpi.amber {
  background: var(--amber-soft);
}

.kpi.red {
  background: var(--red-soft);
}

.dashboard-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-grid {
  grid-template-columns: 1fr 1fr;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel + .panel,
.editor {
  margin-top: 16px;
}

.wide {
  grid-column: span 2;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title h2 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.panel-title span {
  color: #748491;
  font-size: 12px;
  line-height: 1.5;
}

.panel-title-with-filter {
  align-items: flex-end;
}

.inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.inline-filter select {
  min-width: 132px;
  min-height: 34px;
  padding: 6px 9px;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 50px 1fr 110px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

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

.bar {
  height: 100%;
  border-radius: inherit;
}

.bar.green {
  background: var(--green);
}

.bar.gray {
  background: #7b8a94;
}

.bar.blue {
  background: var(--blue);
}

.bar.amber {
  background: var(--amber);
}

.stat-line {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.stat-line:last-child {
  border-bottom: 0;
}

.stat-line span {
  color: var(--text);
}

.stat-line strong {
  color: var(--blue);
}

.stat-line em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.table-wrap {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafc;
  color: #51606d;
  font-weight: 800;
  font-size: 12px;
}

td {
  color: #25313a;
}

th:last-child,
td:last-child {
  width: 220px;
}

.order-customer-cell {
  display: inline-flex;
  min-width: 138px;
  flex-direction: column;
  gap: 4px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.order-customer-cell strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.order-customer-cell small {
  color: var(--muted);
  font-size: 12px;
}

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

tbody tr:hover {
  background: #f8fbfd;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border-soft);
  background: white;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(28, 43, 56, 0.04);
}

.link-action {
  min-width: 70px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #d5e7f8;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  margin-right: 6px;
}

.customer-editor {
  padding: 22px 24px 20px;
}

.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px 18px;
  align-items: end;
}

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

.customer-form-grid textarea {
  min-height: 86px;
}

.customer-list-panel {
  padding: 14px;
}

.customer-list-panel .table-wrap {
  border-radius: 8px;
}

.customer-title-cell {
  display: grid;
  gap: 4px;
}

.customer-title-cell strong {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.customer-title-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.customer-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid #cce7dd;
  border-radius: 999px;
  background: #eefaf5;
  color: #08735f;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.customer-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-table-actions .link-action {
  margin-right: 0;
}

.danger-icon {
  color: var(--red);
  font-size: 18px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #34434d;
  font-size: 13px;
}

label span {
  font-weight: 700;
}

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

.form-actions {
  margin-top: 14px;
  justify-content: flex-end;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-color: var(--border);
  color: var(--text);
}

.file-button input {
  display: none;
}

.permissions {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.permissions legend {
  padding: 0 6px;
  color: #34434d;
  font-weight: 700;
}

.permission-grid {
  display: grid;
  gap: 6px;
}

.permission-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(96px, 1.1fr) repeat(4, minmax(86px, 1fr));
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.permission-row strong {
  font-size: 13px;
}

.check {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  line-height: 1.1;
  font-weight: 400;
  white-space: nowrap;
}

.permissions .check input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  box-shadow: none;
}

.empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed #d8e3ec;
  border-radius: 8px;
}

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

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

  .dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar {
    display: grid;
  }

  .topbar-actions,
  .toolbar-row {
    justify-content: flex-start;
  }

  .search {
    width: 100%;
  }

  .kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .permission-row {
    grid-template-columns: 1fr 1fr;
  }

  .main {
    padding: 18px;
  }

  .bar-row {
    grid-template-columns: 44px 1fr;
  }

  .bar-row strong {
    grid-column: 2;
  }
}

/* V3 dashboard */
.shell-v3 {
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--workspace-bg);
}

.sidebar-v3 {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
  gap: 0;
}

.brand-v3 {
  min-height: 82px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-v3 strong {
  font-size: 21px;
  letter-spacing: 0;
  color: #fff;
}

.brand-v3 span {
  color: #9bb0b8;
  line-height: 1.45;
}

.sidebar-v3 nav {
  gap: 5px;
  margin-top: 10px;
  padding: 0 10px;
}

.nav-item-v3 {
  position: relative;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 13px;
  color: #cbd8de;
  font-size: 14px;
  font-weight: 800;
}

.nav-item-v3 svg {
  width: 20px;
  height: 20px;
}

.nav-item-v3.active,
.nav-item-v3:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-item-v3.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: #21c6ad;
}

.sidebar-v3 .sidebar-footer {
  padding: 16px 20px 20px;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-header-v3,
.mobile-menu-toggle,
.mobile-drawer-close,
.mobile-drawer-backdrop {
  display: none;
}

.main-v3 {
  position: relative;
  z-index: 1;
  padding: 0 24px 28px;
  min-width: 0;
}

.topbar-v3 {
  position: relative;
  z-index: 5;
  min-height: 70px;
  margin: 0 -24px 14px;
  padding: 9px 28px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 2px rgba(22, 34, 44, 0.04);
}

.topbar-v3 > div:first-child {
  min-width: 0;
}

.topbar-v3 h1 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-greeting {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dashboard-greeting > span:last-child {
  min-width: 0;
}

.topbar-v3 p {
  margin-top: 5px;
  color: #728391;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.topbar-actions-v3 {
  align-items: center;
  gap: 10px;
}

.search-box {
  width: min(520px, 34vw);
  height: 44px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 43, 56, 0.04);
}

.search-box svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #8696a6;
  stroke-width: 2;
}

.search-box input {
  border: 0;
  min-height: 36px;
  padding: 0;
  box-shadow: none;
}

.search-submit {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #0c8f78;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.search-clear {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #edf2f6;
  color: #536473;
  cursor: pointer;
}

.search-clear svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.result-summary {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: #607080;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.result-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
}

.result-summary strong {
  color: #263440;
}

.result-summary em {
  color: #8291a0;
  font-style: normal;
}

.account-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  color: #23313c;
  font-weight: 800;
  padding: 4px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.account-chip:hover {
  background: #f5f8fb;
  border-color: var(--border-soft);
}

.account-chip svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.avatar {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: #2f86ff;
  color: #fff;
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.small-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.large-avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.greeting-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.main-v3::before {
  content: "";
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  height: 300px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #f7fafc 0%, rgba(244, 247, 251, 0) 100%);
}

.main-v3 > section,
.main-v3 > .dashboard-toolbar,
.main-v3 > .kpi-grid,
.main-v3 > .dashboard-layout,
.main-v3 > .link-banner,
.main-v3 > .result-summary {
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
}

.topbar-v3 {
  min-height: 70px;
  padding: 10px 30px;
}

.topbar-v3 h1 {
  letter-spacing: 0;
}

.topbar-actions-v3 .primary,
.topbar-actions-v3 .ghost {
  min-height: 38px;
  padding-inline: 16px;
}

.search-box {
  height: 42px;
  border-color: #dfe9f1;
  box-shadow: 0 8px 20px rgba(23, 36, 48, 0.05);
}

.panel {
  border-radius: 8px;
  border-color: #e3ebf3;
  box-shadow: 0 1px 2px rgba(15, 25, 33, 0.04), 0 16px 34px rgba(31, 44, 56, 0.07);
}

.panel-title {
  min-height: 36px;
}

.panel-title h2 {
  color: #132331;
  font-weight: 900;
}

.panel-title span {
  font-weight: 700;
}

.editor {
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.editor::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #17b69e, rgba(47, 134, 255, 0.34), rgba(255, 255, 255, 0));
}

.editor .panel-title {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.form-grid {
  gap: 16px 18px;
  align-items: end;
}

.form-grid label {
  min-width: 0;
}

.form-grid label span {
  color: #263847;
  font-size: 13px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.avatar-edit-row > input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-color: #dce7ef;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: #122231;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.form-grid input[readonly],
.form-grid textarea[readonly] {
  background: #f8fbfd;
  color: #415363;
}

.form-grid textarea {
  min-height: 104px;
  line-height: 1.6;
}

.form-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.table-wrap {
  box-shadow: var(--shadow-soft);
}

th {
  height: 44px;
  background: linear-gradient(180deg, #f9fbfd 0%, #f2f6fa 100%);
  color: #485b6b;
  letter-spacing: 0;
}

td {
  height: 58px;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #f4f9fc;
}

.row-actions {
  gap: 8px;
  width: 170px;
  min-width: 170px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-color: #dce7ef;
}

.link-action {
  min-height: 32px;
  padding: 6px 11px;
}

.status {
  min-height: 26px;
  padding: 4px 10px;
}

.dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 340px) auto minmax(160px, 220px) minmax(160px, 220px) 116px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.date-range,
.quick-tabs,
.dashboard-toolbar select {
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(28, 43, 56, 0.035);
}

.date-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #334452;
  font-weight: 800;
}

.date-range input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
  color: #273846;
  font-weight: 800;
  box-shadow: none;
}

.date-range input:focus-visible {
  border-color: transparent;
  box-shadow: none;
}

.quick-tabs {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  overflow: visible;
}

.quick-tabs button {
  border: 0;
  border-right: 1px solid var(--border-soft);
  background: #fff;
  color: #506171;
  font-weight: 800;
  min-height: 40px;
  padding: 6px 10px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quick-tabs button:last-child {
  border-right: 0;
}

.quick-tabs button.active {
  background: #0c8f78;
  color: #fff;
}

.dashboard-toolbar .primary {
  min-height: 40px;
  font-weight: 800;
}

.kpi-grid-v3 {
  grid-template-columns: repeat(7, minmax(124px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-v3 {
  min-height: 96px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfeff 100%);
  gap: 5px;
  padding: 12px;
  border-color: var(--border-soft);
  box-shadow: 0 1px 2px rgba(15, 25, 33, 0.035), 0 10px 20px rgba(31, 44, 56, 0.045);
}

.kpi-v3 .kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.kpi-v3 .kpi-head span {
  color: #40505e;
  font-size: 12px;
  font-weight: 800;
}

.kpi-v3 i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-style: normal;
  border-radius: 8px;
  background: #f5f8fa;
}

.kpi-v3 svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.kpi-v3 strong {
  color: #087d6b;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.kpi-v3.blue strong,
.kpi-v3.blue i {
  color: #1677ff;
}

.kpi-v3.green strong,
.kpi-v3.green i,
.kpi-v3.teal strong,
.kpi-v3.teal i {
  color: #0f9b83;
}

.kpi-v3.red strong,
.kpi-v3.red i {
  color: #f03545;
}

.kpi-v3.amber strong,
.kpi-v3.amber i {
  color: #d97706;
}

.kpi-v3 small {
  color: #7d8b98;
  font-size: 12px;
  font-weight: 700;
}

.kpi-v3 small.compare {
  color: #21ba72;
}

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

.dashboard-layout .panel {
  min-height: 220px;
  border-color: var(--border-soft);
  box-shadow: var(--shadow-panel);
}

.dashboard-layout .table-wrap {
  overflow-x: visible;
}

.dashboard-layout table {
  table-layout: fixed;
  font-size: 12px;
}

.dashboard-layout th,
.dashboard-layout td {
  padding: 10px 9px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

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

.chart-panel {
  min-height: 360px;
}

.chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: 0 0 8px;
  color: #526574;
  font-weight: 700;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
}

.dot.green {
  background: #12b99f;
}

.dot.blue {
  background: #1d78ff;
}

.dot.orange {
  background: #ff8133;
}

.trend-chart {
  height: 250px;
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 14px 8px 0;
  border-left: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(#edf3f7 1px, transparent 1px) 0 0 / 100% 25%,
    #fff;
}

.trend-col {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 24px;
  align-items: end;
  gap: 6px;
}

.trend-col span {
  text-align: center;
  color: #566777;
  font-size: 12px;
  font-weight: 800;
}

.bar-stack {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.bar-stack i {
  width: 9px;
  min-height: 4px;
  border-radius: 2px 2px 0 0;
}

.bar-income {
  background: #12b99f;
}

.bar-cost {
  background: #2f86ff;
}

.bar-profit {
  background: #ff8133;
}

.trend-col.active span {
  color: #0e9d8c;
}

.bank-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.bank-stat-card {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbfe 100%);
}

.bank-stat-card strong {
  color: #1f4f85;
  font-size: 15px;
}

.bank-stat-card b {
  color: #07836f;
  font-size: 20px;
}

.bank-stat-card span,
.bank-stat-card em {
  color: #5b6b79;
  font-size: 13px;
  font-style: normal;
}

.bank-stat-card em {
  color: #16a060;
  font-weight: 800;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 138px;
}

.donut {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.donut > div {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

.donut span {
  color: #738391;
  font-size: 11px;
  font-weight: 800;
}

.donut strong {
  color: #202c36;
  font-size: 14px;
}

.donut-legend {
  display: grid;
  gap: 8px;
  min-width: 138px;
}

.donut-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #536371;
  font-size: 13px;
  font-weight: 700;
}

.donut-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.donut-legend b {
  color: #566575;
}

.split-panel {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
  align-items: center;
}

.currency-panel .split-panel {
  grid-template-columns: 1fr;
}

.avatar-field {
  align-items: start;
}

.avatar-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-edit-row > input[name="avatarInitial"] {
  width: 92px;
  text-align: center;
  font-weight: 900;
}

.profile-editor {
  margin-bottom: 16px;
}

.status-done {
  background: #e8f8ef;
  color: #119456;
}

.status-warn {
  background: #fff4d8;
  color: #b06b00;
}

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

.status-info {
  background: #eaf4ff;
  color: #1677ff;
}

.danger-icon svg {
  stroke: var(--red);
}

@media (max-width: 1460px) {
  .kpi-grid-v3 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .span-2,
  .span-4 {
    grid-column: span 1;
  }

  .split-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .dashboard-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .dashboard-toolbar {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (min-width: 761px) and (max-width: 1120px) {
  .shell-v3 {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .main-v3 {
    padding: 0 18px 24px;
  }

  .topbar-v3 {
    margin: 0 -18px 14px;
    padding: 10px 20px;
    align-items: flex-start;
  }

  .topbar-actions-v3 {
    flex: 1 1 360px;
  }

  .topbar-actions-v3 .search-box {
    width: min(420px, 100%);
  }

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

  .settings-grid {
    grid-template-columns: 1fr;
  }

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

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

  .mobile-bottom-nav {
    display: none;
  }

  .sidebar-v3 {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .brand-v3 {
    min-height: 72px;
    justify-content: center;
    padding: 14px 0;
  }

  .brand-v3::before {
    content: "贸";
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #12a98f 0%, #0b7968 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(11, 121, 104, 0.26);
  }

  .brand-v3 strong {
    display: none;
  }

  .brand-v3 span,
  .sidebar-v3 .sidebar-footer,
  .nav-item-v3 span {
    display: none;
  }

  .sidebar-v3 nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 10px 12px;
    scrollbar-width: thin;
  }

  .nav-item-v3 {
    width: 60px;
    margin-inline: auto;
    justify-content: center;
    padding: 0;
  }
}

@media (min-width: 761px) and (max-width: 1120px) and (orientation: portrait) {
  body {
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, #f7fbfd 0%, #eef5f8 100%);
  }

  .shell-v3 {
    display: block;
    grid-template-columns: 1fr;
    background: transparent;
  }

  .mobile-header-v3 {
    position: sticky;
    top: 0;
    z-index: 68;
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    color: #fff;
    background: rgba(14, 31, 39, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 20px rgba(8, 20, 27, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    isolation: isolate;
  }

  .mobile-header-title {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .mobile-header-title strong {
    font-size: 17px;
    line-height: 1.2;
  }

  .mobile-header-title span {
    color: #9bb0b8;
    font-size: 10.5px;
  }

  .mobile-menu-toggle,
  .mobile-drawer-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle:active,
  .mobile-drawer-close:active {
    transform: scale(0.96);
  }

  .mobile-menu-toggle svg,
  .mobile-drawer-close svg {
    width: 18px;
    height: 18px;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(8, 20, 27, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .shell-v3.mobile-drawer-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar.sidebar-v3 {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    width: min(276px, 84vw);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    overflow: hidden auto;
    overscroll-behavior: contain;
    padding: 0;
    gap: 0;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease;
    will-change: transform;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 22px 0 42px rgba(7, 18, 25, 0);
  }

  .shell-v3.mobile-drawer-open .sidebar.sidebar-v3 {
    transform: translate3d(0, 0, 0);
    box-shadow: 22px 0 42px rgba(7, 18, 25, 0.26);
  }

  .brand-v3 {
    position: relative;
    top: auto;
    z-index: 50;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 14px 12px;
    background: linear-gradient(135deg, #14242d 0%, #0f2d32 100%);
    box-shadow: none;
  }

  .brand-v3::before {
    content: none;
  }

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

  .brand-v3 span {
    display: block;
    font-size: 11px;
  }

  .sidebar-v3 nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px 10px;
  }

  .nav-item-v3 {
    width: auto;
    min-height: 46px;
    margin-inline: 0;
    justify-content: flex-start;
    padding: 0 13px;
    font-size: 14px;
  }

  .nav-item-v3 span {
    display: inline;
  }

  .mobile-drawer-nav .nav-item-v3 {
    border-radius: 12px;
    color: #d7e5e8;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }

  .mobile-drawer-nav .nav-item-v3.active,
  .mobile-drawer-nav .nav-item-v3:hover {
    background: rgba(33, 198, 173, 0.16);
    color: #fff;
  }

  .mobile-drawer-nav .nav-item-v3:active {
    transform: scale(0.98);
  }

  .mobile-drawer-nav .nav-item-v3.active::before {
    left: 0;
    width: 3px;
    height: 22px;
    border-radius: 999px;
  }

  .sidebar-v3 .sidebar-footer {
    display: grid;
    gap: 8px;
    padding: 12px 14px 16px;
  }

  .sidebar-v3 .sidebar-footer .ghost {
    min-height: 42px;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: none;
  }

  .main-v3 {
    margin-top: 0;
    padding: 0 14px 22px;
  }

  .main-v3::before {
    display: none;
  }

  .topbar {
    display: grid;
  }

  .topbar-v3 {
    position: static;
    margin: 0 -14px 10px;
    padding: 12px 16px 14px;
    border-radius: 0 0 20px 20px;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(31, 44, 56, 0.09);
  }

  .topbar-v3 h1 {
    font-size: 21px;
  }

  .topbar-v3 p {
    font-size: 12px;
    line-height: 1.55;
  }

  .topbar-actions-v3 {
    flex: initial;
    width: 100%;
    align-items: stretch;
  }

  .topbar-actions-v3 .search-box {
    width: 100%;
  }

  .dashboard-greeting {
    align-items: flex-start;
    gap: 10px;
  }

  .greeting-avatar {
    width: 38px;
    height: 38px;
  }

  .search-box {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 48px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(31, 44, 56, 0.08);
  }

  .search-box input {
    padding-right: 34px;
  }

  .search-clear {
    position: absolute;
    right: 70px;
    top: 9px;
    width: 28px;
    height: 28px;
  }

  .dashboard-toolbar,
  .kpi-grid-v3,
  .bank-cards {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .date-range,
  .dashboard-toolbar select {
    height: auto;
    min-height: 44px;
    border-radius: 12px;
  }

  .date-range input {
    height: 38px;
    font-size: 14px;
  }

  .quick-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    border-radius: 12px;
    overflow: visible;
  }

  .quick-tabs button {
    min-height: 44px;
    font-weight: 900;
  }

  .kpi-grid-v3 {
    gap: 10px;
  }

  .kpi-v3 {
    min-height: 104px;
    border-radius: 14px;
    padding: 14px;
  }

  .kpi-v3 strong {
    font-size: 22px;
  }

  .dashboard-layout {
    gap: 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 26px rgba(31, 44, 56, 0.08);
  }

  .panel-title {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
  }

  .panel-title h2 {
    font-size: 17px;
  }

  .panel-title span {
    text-align: left;
  }

  .panel-title-with-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-filter {
    width: 100%;
    justify-content: space-between;
  }

  .inline-filter select {
    flex: 1;
    min-width: 0;
  }

  .editor {
    padding: 16px;
    border-radius: 14px;
  }

  .editor::before {
    border-radius: 14px 14px 0 0;
  }

  .link-banner,
  .result-summary {
    border-radius: 14px;
  }

  .trend-chart {
    height: 280px;
    gap: 6px;
    overflow-x: auto;
  }

  .bar-stack i {
    width: 8px;
  }

  .donut-wrap {
    flex-direction: column;
  }

  .table-wrap {
    border: 0;
    overflow-x: visible;
    background: transparent;
    box-shadow: none;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    display: grid;
    gap: 0;
    grid-auto-rows: auto;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(31, 44, 56, 0.08);
  }

  tbody tr:nth-child(even),
  tbody tr:hover {
    background: #fff;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.45;
    align-items: start;
  }

  td:first-child {
    padding-top: 0;
  }

  td:last-child {
    width: 100%;
    padding-bottom: 0;
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: #7a8a96;
    font-size: 12px;
    font-weight: 800;
  }

  td[data-label="操作"] {
    grid-template-columns: 1fr;
  }

  td[data-label="操作"]::before {
    display: none;
  }

  td[data-label="操作"] .row-actions,
  td[data-label="操作"] .customer-table-actions {
    width: 100%;
    flex-wrap: wrap;
  }

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

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

  .icon-btn,
  .link-action {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .icon-btn {
    flex-basis: auto;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar-row .segmented,
  .toolbar-row .button-row {
    width: 100%;
  }

  .toolbar-row .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar-row .segmented button {
    min-height: 42px;
    padding-inline: 8px;
  }

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

  .form-grid,
  .customer-form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .form-grid label span {
    color: #607282;
    font-size: 12px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .avatar-edit-row > input {
    border-radius: 12px;
    background: #fbfdff;
  }

  .permissions {
    padding: 10px;
    border-radius: 14px;
    background: #fff;
  }

  .permission-grid {
    gap: 8px;
  }

  .permission-row {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .permission-row strong {
    font-size: 14px;
  }

  .avatar-edit-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .form-actions,
  .button-row {
    width: 100%;
    align-items: stretch;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea,
  .primary,
  .ghost,
  .danger,
  .file-button {
    min-height: 44px;
    font-size: 15px;
  }

  .small {
    min-height: 40px;
  }

  .topbar-actions-v3 .primary,
  .topbar-actions-v3 .ghost,
  .button-row .primary,
  .button-row .ghost,
  .button-row .file-button {
    width: 100%;
  }

  .customer-list-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .empty {
    min-height: 120px;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
    text-align: center;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, #f7fbfd 0%, #eef5f8 100%);
  }

  .login-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    place-items: center;
  }

  .login-panel {
    width: 100%;
    max-width: 420px;
    padding: 24px 18px 20px;
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(21, 35, 45, 0.13);
  }

  .login-panel h1 {
    margin: 20px 0 16px;
    font-size: 24px;
  }

  .login-panel p {
    margin-bottom: 16px;
    font-size: 12px;
  }

  .login-brand {
    gap: 10px;
    font-size: 17px;
  }

  .login-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .shell-v3 {
    display: block;
    grid-template-columns: 1fr;
    background: transparent;
  }

  .mobile-header-v3 {
    position: sticky;
    top: 0;
    z-index: 68;
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    color: #fff;
    background: rgba(14, 31, 39, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 20px rgba(8, 20, 27, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    isolation: isolate;
  }

  .mobile-header-title {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .mobile-header-title strong {
    font-size: 17px;
    line-height: 1.2;
  }

  .mobile-header-title span {
    color: #9bb0b8;
    font-size: 10.5px;
  }

  .mobile-menu-toggle,
  .mobile-drawer-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-menu-toggle:active,
  .mobile-drawer-close:active {
    transform: scale(0.96);
  }

  .mobile-menu-toggle svg,
  .mobile-drawer-close svg {
    width: 18px;
    height: 18px;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(8, 20, 27, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .shell-v3.mobile-drawer-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar.sidebar-v3 {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    width: min(276px, 84vw);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    overflow: hidden auto;
    overscroll-behavior: contain;
    padding: 0;
    gap: 0;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease;
    will-change: transform;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 22px 0 42px rgba(7, 18, 25, 0);
  }

  .shell-v3.mobile-drawer-open .sidebar.sidebar-v3 {
    transform: translate3d(0, 0, 0);
    box-shadow: 22px 0 42px rgba(7, 18, 25, 0.26);
  }

  .brand-v3 {
    position: relative;
    top: auto;
    z-index: 50;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 14px 12px;
    background: linear-gradient(135deg, #14242d 0%, #0f2d32 100%);
    box-shadow: none;
  }

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

  .brand-v3 span {
    font-size: 11px;
  }

  .sidebar-v3 nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px 10px;
  }

  .nav-item-v3 {
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 13px;
    font-size: 14px;
  }

  .mobile-drawer-nav .nav-item-v3 {
    border-radius: 12px;
    color: #d7e5e8;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }

  .mobile-drawer-nav .nav-item-v3.active,
  .mobile-drawer-nav .nav-item-v3:hover {
    background: rgba(33, 198, 173, 0.16);
    color: #fff;
  }

  .mobile-drawer-nav .nav-item-v3:active {
    transform: scale(0.98);
  }

  .mobile-drawer-nav .nav-item-v3.active::before {
    left: 0;
    width: 3px;
    height: 22px;
    border-radius: 999px;
  }

  .main-v3 {
    margin-top: 0;
    padding: 0 14px 22px;
  }

  .main-v3::before {
    display: none;
  }

  .topbar-v3 {
    position: static;
    margin: 0 -14px 10px;
    padding: 12px 16px 14px;
    border-radius: 0 0 20px 20px;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(31, 44, 56, 0.09);
  }

  .topbar-v3 h1 {
    font-size: 21px;
  }

  .topbar-v3 p {
    font-size: 12px;
    line-height: 1.55;
  }

  .dashboard-greeting {
    align-items: flex-start;
    gap: 10px;
  }

  .greeting-avatar {
    width: 38px;
    height: 38px;
  }

  .search-box {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 48px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(31, 44, 56, 0.08);
  }

  .search-box input {
    padding-right: 34px;
  }

  .search-clear {
    position: absolute;
    right: 70px;
    top: 9px;
    width: 28px;
    height: 28px;
  }

  .dashboard-toolbar,
  .kpi-grid-v3,
  .bank-cards {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .date-range,
  .dashboard-toolbar select {
    height: auto;
    min-height: 44px;
    border-radius: 12px;
  }

  .date-range input {
    height: 38px;
    font-size: 14px;
  }

  .quick-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    border-radius: 12px;
    overflow: visible;
  }

  .quick-tabs button {
    min-height: 44px;
    font-weight: 900;
  }

  .kpi-grid-v3 {
    gap: 10px;
  }

  .kpi-v3 {
    min-height: 104px;
    border-radius: 14px;
    padding: 14px;
  }

  .kpi-v3 strong {
    font-size: 22px;
  }

  .dashboard-layout {
    gap: 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 26px rgba(31, 44, 56, 0.08);
  }

  .panel-title {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
  }

  .panel-title h2 {
    font-size: 17px;
  }

  .panel-title span {
    text-align: left;
  }

  .panel-title-with-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-filter {
    width: 100%;
    justify-content: space-between;
  }

  .inline-filter select {
    flex: 1;
    min-width: 0;
  }

  .editor {
    padding: 16px;
    border-radius: 14px;
  }

  .editor::before {
    border-radius: 14px 14px 0 0;
  }

  .link-banner,
  .result-summary {
    border-radius: 14px;
  }

  .trend-chart {
    height: 280px;
    gap: 6px;
    overflow-x: auto;
  }

  .bar-stack i {
    width: 8px;
  }

  .donut-wrap {
    flex-direction: column;
  }

  .sidebar-v3 {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-v3 nav {
    display: grid;
  }

  .sidebar-v3 .sidebar-footer {
    display: grid;
    gap: 8px;
    padding: 12px 14px 16px;
  }

  .sidebar-v3 .sidebar-footer .ghost {
    min-height: 42px;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: none;
  }

  .table-wrap {
    border: 0;
    overflow-x: visible;
    background: transparent;
    box-shadow: none;
  }

  table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    display: grid;
    gap: 0;
    grid-auto-rows: auto;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(31, 44, 56, 0.08);
  }

  tbody tr:nth-child(even),
  tbody tr:hover {
    background: #fff;
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.45;
    align-items: start;
  }

  td:first-child {
    padding-top: 0;
  }

  td:last-child {
    width: 100%;
    padding-bottom: 0;
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: #7a8a96;
    font-size: 12px;
    font-weight: 800;
  }

  td[data-label="操作"] {
    grid-template-columns: 1fr;
  }

  td[data-label="操作"]::before {
    display: none;
  }

  td[data-label="操作"] .row-actions,
  td[data-label="操作"] .customer-table-actions {
    width: 100%;
    flex-wrap: wrap;
  }

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

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

  .icon-btn,
  .link-action {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .icon-btn {
    flex-basis: auto;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar-row .segmented,
  .toolbar-row .button-row {
    width: 100%;
  }

  .toolbar-row .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar-row .segmented button {
    min-height: 42px;
    padding-inline: 8px;
  }

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

  .form-grid,
  .customer-form-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .form-grid label span {
    color: #607282;
    font-size: 12px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .avatar-edit-row > input {
    border-radius: 12px;
    background: #fbfdff;
  }

  .permissions {
    padding: 10px;
    border-radius: 14px;
    background: #fff;
  }

  .permission-grid {
    gap: 8px;
  }

  .permission-row {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .permission-row strong {
    font-size: 14px;
  }

  .avatar-edit-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .form-actions,
  .button-row,
  .topbar-actions-v3 {
    width: 100%;
    align-items: stretch;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea,
  .primary,
  .ghost,
  .danger,
  .file-button {
    min-height: 44px;
    font-size: 15px;
  }

  .small {
    min-height: 40px;
  }

  .topbar-actions-v3 .primary,
  .topbar-actions-v3 .ghost,
  .button-row .primary,
  .button-row .ghost,
  .button-row .file-button {
    width: 100%;
  }

  .customer-list-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .empty {
    min-height: 120px;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
    text-align: center;
  }
}
