:root {
  --bg: #f4efe7;
  --bg-soft: #fbf7f0;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fffdf9;
  --line: rgba(70, 52, 33, 0.1);
  --line-strong: rgba(20, 54, 82, 0.14);
  --text: #2d241d;
  --muted: #7d6a57;
  --brand: #155e75;
  --brand-strong: #0f4c5f;
  --accent: #eb7f2d;
  --accent-soft: rgba(235, 127, 45, 0.12);
  --success: #237a57;
  --danger: #b54f34;
  --shadow: 0 18px 40px rgba(89, 63, 38, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Source Han Sans SC", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-size: 14px;
  background:
    radial-gradient(circle at top left, rgba(21, 94, 117, 0.16), transparent 24%),
    radial-gradient(circle at right 12% top 18%, rgba(235, 127, 45, 0.12), transparent 22%),
    linear-gradient(180deg, #f8f4ed 0%, #efe6d7 100%);
}

.app-body,
.login-body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.button,
input,
select,
textarea {
  font: inherit;
}

button,
.button {
  border: 0;
  cursor: pointer;
  padding: 11px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 10px 24px rgba(21, 94, 117, 0.18);
}

button:hover,
.button:hover {
  transform: translateY(-1px);
}

.button.ghost,
.page-nav,
.page-chip,
.logout-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  border: 1px solid rgba(21, 94, 117, 0.16);
  box-shadow: none;
}

.button.ghost:hover,
.page-nav:hover,
.page-chip:hover,
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.96);
}

button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.eyebrow,
.user-role,
.metric small,
.section-head p,
.lead,
.scroll-hint,
.empty,
.empty-cell,
.flash,
.stat-label,
.brand-sub {
  color: var(--muted);
}

.eyebrow,
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-badge {
  color: var(--brand);
}

.lead {
  font-size: 12px;
  line-height: 1.75;
}

.lead.compact {
  margin-bottom: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 22px;
  min-height: 100vh;
  padding: 22px;
}

.app-sidebar {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.app-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.page {
  padding: 24px;
}

.card,
.hero,
.brand-card,
.dashboard-menu,
.dashboard-filter,
.dashboard-topbar,
.auth-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  max-width: 100%;
}

.card,
.hero,
.dashboard-filter,
.dashboard-topbar {
  padding: 22px 24px;
}

.brand-card {
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(247, 243, 236, 0.92)),
    linear-gradient(135deg, rgba(21, 94, 117, 0.08), rgba(235, 127, 45, 0.06));
}

.brand-mark {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 800;
  color: #203245;
}

.brand-sub {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
}

.brand-meta {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}

.brand-meta span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(70, 52, 33, 0.08);
}

.dashboard-menu {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  color: #57493b;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.dashboard-menu a:hover {
  background: rgba(21, 94, 117, 0.08);
  color: var(--brand);
}

.dashboard-menu a.active {
  background: linear-gradient(135deg, rgba(235, 127, 45, 0.16), rgba(235, 127, 45, 0.08));
  color: #a64d15;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(70, 52, 33, 0.08);
  display: grid;
  gap: 10px;
}

.user-meta {
  display: grid;
  gap: 6px;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
}

.user-role {
  font-size: 10px;
}

.logout-btn {
  display: inline-flex;
  justify-content: center;
  padding: 10px 14px;
}

.hero,
.section-head,
.toolbar,
.layout-two,
.metric-grid,
.detail-grid,
.form-page .section-head,
.form-grid {
  display: grid;
  gap: 16px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.hero h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 246, 240, 0.78));
  border: 1px solid rgba(70, 52, 33, 0.08);
}

.metric.emphasis {
  background: linear-gradient(180deg, rgba(255, 244, 232, 0.96), rgba(255, 250, 245, 0.8));
  border-color: rgba(235, 127, 45, 0.18);
}

.metric span {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  color: #6a594a;
}

.metric strong {
  display: block;
  margin-bottom: 7px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.1;
}

.metric small {
  display: block;
  font-size: 10px;
  line-height: 1.55;
}

.metric.mini strong {
  font-size: 22px;
}

.settlement-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #5d4c3c;
  font-size: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(70, 52, 33, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(21, 94, 117, 0.4);
  box-shadow: 0 0 0 3px rgba(21, 94, 117, 0.08);
}

textarea {
  resize: vertical;
}

.toolbar {
  grid-template-columns: 180px minmax(280px, 1fr) auto auto;
  align-items: center;
  margin-bottom: 14px;
}

.layout-two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.compact-gap {
  gap: 18px;
}

.inner-card {
  padding: 18px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-page .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid div,
.note-block,
.empty,
.flash,
.error {
  border-radius: 18px;
  padding: 14px 16px;
}

.detail-grid div,
.note-block,
.empty {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.detail-grid strong,
.note-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  color: #6a594a;
}

.flash {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(235, 127, 45, 0.18);
  box-shadow: var(--shadow);
}

.flash-fixed {
  margin: 22px 22px 0 22px;
}

.error {
  background: rgba(181, 79, 52, 0.1);
  border: 1px solid rgba(181, 79, 52, 0.14);
  color: var(--danger);
}

.empty,
.empty-cell {
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
  border-radius: 20px;
  border: 1px solid rgba(70, 52, 33, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.table-wrap::-webkit-scrollbar,
.daily-card-strip::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.table-wrap::-webkit-scrollbar-thumb,
.daily-card-strip::-webkit-scrollbar-thumb {
  background: rgba(21, 94, 117, 0.24);
  border-radius: 999px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.data-table {
  table-layout: fixed;
}

.order-table {
  min-width: 4200px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #233247;
  color: #fff;
  font-weight: 700;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(70, 52, 33, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.2;
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.35);
}

tbody tr:hover td {
  background: rgba(21, 94, 117, 0.05);
}

.th-inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  position: relative;
  padding-right: 14px;
}

.th-inner span:first-child {
  display: block;
  flex: 1 1 auto;
  line-height: 1.15;
  white-space: normal;
  word-break: break-all;
}

.cell-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.order-table .cell-content.field-address,
.order-table .cell-content.field-product_name,
.order-table .cell-content.field-note {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-all;
}

.order-table th[data-field="order_id"],
.order-table th[data-field="order_time"],
.order-table th[data-field="phone"],
.order-table th[data-field="region_name"],
.order-table th[data-field="staff_name"],
.order-table th[data-field="waybill_code"],
.order-table th[data-field="agent_settlement_status"] {
  width: 180px;
}

.order-table th[data-field="address"] {
  width: 320px;
}

.order-table th[data-field="product_name"],
.order-table th[data-field="note"] {
  width: 260px;
}

.order-table th[data-field="wechat_ref_code"],
.order-table th[data-field="wechat_prepay"],
.order-table th[data-field="qr_amount"],
.order-table th[data-field="campaign_name"],
.order-table th[data-field="wechat_amount"],
.order-table th[data-field="wechat_refund_amount"],
.order-table th[data-field="warehouse_name"],
.order-table th[data-field="return_freight_date"],
.order-table th[data-field="settlement_amount"],
.order-table th[data-field="product_cost"],
.order-table th[data-field="total_refund_amount"],
.order-table th[data-field="total_income"],
.order-table th[data-field="profit_gap"] {
  width: 190px;
}

.resizable-col {
  position: relative;
}

.col-resizer {
  position: absolute;
  right: -8px;
  top: -12px;
  z-index: 2;
  width: 14px;
  min-width: 14px;
  height: calc(100% + 24px);
  cursor: col-resize;
}

.col-resizer::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 2px;
  height: 28px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.72);
}

.actions-col {
  width: 190px;
}

.order-col {
  border-right: 1px solid rgba(70, 52, 33, 0.08);
}

.order-table th.pair-divider::before {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 2px;
  height: 28px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
}

.order-table td.pair-divider-body {
  border-right: 1px solid rgba(70, 52, 33, 0.08);
}

.select-col {
  width: 44px;
  text-align: center;
}

.row-actions,
.pager-inline,
.table-foot,
.pager-panel,
.pager-form,
.filter-row,
.filter-form,
.dashboard-filter-bar,
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions {
  gap: 12px;
}

.text-link,
.link-button {
  color: var(--brand);
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.danger {
  color: var(--danger);
}

.table-foot {
  justify-content: space-between;
  margin-top: 12px;
}

.pager-panel {
  justify-content: flex-end;
}

.page-chip {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
}

.page-chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
}

.page-nav {
  padding: 9px 12px;
  border-radius: 999px;
}

.page-nav.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-ellipsis {
  color: #897865;
}

.pager-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.pager-form select,
.pager-form input {
  width: auto;
  min-width: 96px;
  padding: 8px 10px;
  border-radius: 12px;
}

.page-jump input {
  min-width: 72px;
}

.toolbar .search-field-select {
  min-width: 140px;
}

.voucher-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; }

.toolbar input[name="q"] {
  min-width: 320px;
}

.toolbar input[type="date"] {
  min-width: 150px;
}

.header-filter-row th {
  background: #2d4058;
  padding: 6px 8px;
  top: 47px;
  z-index: 1;
}

.header-filter-row .filter-empty {
  background: #2d4058;
}

.header-filter-stack {
  display: grid;
  gap: 4px;
}

.header-filter-input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: #233247;
  font-size: 11px;
  line-height: 1.2;
}

.header-filter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.header-filter-actions .button {
  min-width: 0;
  padding: 6px 10px;
  font-size: 11px;
}

.header-filter-select {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.98);
  color: #233247;
  font-size: 11px;
  line-height: 1.2;
}

.header-filter-empty {
  display: block;
  height: 30px;
}

.import-box .button.ghost,
.import-box button[type="submit"] {
  min-width: 140px;
}

.dashboard-filter {
  display: grid;
  gap: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(235, 127, 45, 0.2);
  color: #8a4f1f;
  font-weight: 700;
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--accent), #d9691e);
  color: #fff;
}

.filter-form label {
  min-width: 180px;
  flex: 1 1 180px;
}

.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-card-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  max-height: 780px;
  overflow-y: auto;
  padding-right: 4px;
}

.daily-card {
  min-height: 154px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(235, 127, 45, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,248,241,0.92));
}

.daily-card-head,
.daily-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.daily-card-amount {
  margin: 12px 0 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.daily-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
}

.dashboard-main .table-wrap table {
  min-width: 0;
  table-layout: fixed;
}

.dashboard-main .table-wrap th,
.dashboard-main .table-wrap td {
  padding: 9px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-main .table-wrap th:nth-child(1),
.dashboard-main .table-wrap td:nth-child(1) {
  width: 90px;
}

.dashboard-main .table-wrap th:nth-child(2),
.dashboard-main .table-wrap td:nth-child(2) {
  width: 92px;
}

.dashboard-main .table-wrap th:nth-child(3),
.dashboard-main .table-wrap td:nth-child(3) {
  width: 72px;
}

.dashboard-main .table-wrap th:nth-child(n + 4),
.dashboard-main .table-wrap td:nth-child(n + 4) {
  width: 96px;
}

.data-count-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settled-row td {
  background: rgba(35, 122, 87, 0.08) !important;
}

.settlement-warning-row td {
  background: rgba(181, 79, 52, 0.08) !important;
  color: var(--danger);
}

.settlement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.settlement-left,
.settlement-right {
  min-width: 0;
}

.settlement-right {
  position: sticky;
  top: 16px;
}

.settlement-dashboard,
.settlement-summary {
  background: rgba(255, 251, 245, 0.92);
  border: 1px solid rgba(70, 52, 33, 0.1);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-col,
.dashboard-col > * {
  min-width: 0;
}

.dashboard-col > * {
  height: 100%;
}

.generate-settlement-box,
.dashboard-col .dashboard-filter,
.dashboard-stats.compact {
  border-radius: 18px;
}

.generate-settlement-box {
  padding: 12px;
  background: linear-gradient(135deg, rgba(21, 94, 117, 0.08), rgba(21, 94, 117, 0.03));
  border: 1px solid rgba(21, 94, 117, 0.14);
}

.generate-form {
  display: grid;
  gap: 8px;
}

.generate-form .form-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  align-items: center;
}

.generate-form label,
.dashboard-filter label {
  min-width: 0;
  font-size: 12px;
}

.generate-btn {
  width: 100%;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-stats.compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  padding: 12px 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,242,235,0.9));
  border: 1px solid rgba(70, 52, 33, 0.08);
  border-radius: 16px;
}

.stat-card .stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.stat-card.highlight .stat-value,
.stat-card.highlight .stat-label {
  color: #fff;
}

.stat-card.warning {
  background: rgba(181, 79, 52, 0.08);
  border-color: rgba(181, 79, 52, 0.14);
}

.settlement-summary .section-title,
.settlement-dashboard .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
}

.settlement-summary .section-title::before,
.settlement-dashboard .section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: var(--brand);
}

.summary-table {
  min-width: 100%;
  font-size: 12px;
}

.summary-table .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary-table .total-row td {
  background: rgba(21, 94, 117, 0.06);
  color: var(--brand);
  font-weight: 700;
}

.summary-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.summary-pagination .page-info {
  font-size: 12px;
  color: var(--muted);
}

.summary-pagination .page-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-pagination .page-btn {
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(21, 94, 117, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand);
  box-shadow: none;
}

.summary-pagination .page-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.15fr minmax(340px, 430px);
  gap: 30px;
  padding: 30px;
}

.auth-intro {
  display: grid;
  align-content: center;
  gap: 18px;
}

.intro-points {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.intro-points div {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(70, 52, 33, 0.08);
}

.intro-points strong {
  font-size: 16px;
}

.intro-points span {
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.login-panel {
  align-content: center;
  padding: 26px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(70, 52, 33, 0.08);
}

.panel-head {
  margin-bottom: 6px;
}

.import-box {
  margin-top: 18px;
}

.table-page {
  min-width: 0;
}

.table-page > .hero,
.table-page > .toolbar,
.table-page > .settlement-summary,
.table-page > .import-box,
.table-page > .card {
  width: 100%;
  min-width: 0;
}

.table-page-orders > .hero,
.table-page-orders > .toolbar,
.table-page-orders > .settlement-summary,
.table-page-orders > .import-box {
  max-width: 100%;
  overflow: hidden;
}

.table-page-orders .toolbar {
  grid-template-columns: 160px minmax(260px, 1fr) auto auto;
}

.settlement-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.stat-item {
  min-width: 0;
  border-radius: 18px;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 237, 0.82));
  border: 1px solid rgba(70, 52, 33, 0.08);
  text-align: center;
}

.stat-item.settled {
  background: linear-gradient(180deg, rgba(236, 249, 242, 0.95), rgba(247, 252, 249, 0.88));
}

.stat-item.unsettled {
  background: linear-gradient(180deg, rgba(255, 245, 235, 0.95), rgba(255, 251, 246, 0.88));
}

.stat-item .stat-value {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
  color: #233247;
}

.stat-item .stat-label {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
}

.stat-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-filters .button {
  padding: 8px 12px;
}

.table-page-orders .settlement-summary .settlement-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.table-page-orders .settlement-summary .stat-filters {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.table-page-orders .settlement-summary .stat-item .stat-value {
  font-size: 20px;
}

.table-page-orders .settlement-summary .stat-item .stat-label {
  font-size: 10px;
}

.table-page-orders .generate-settlement-form .form-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.table-page-orders .generate-settlement-form .form-row label {
  min-width: 180px;
  flex: 1 1 180px;
}

.table-page-orders .generate-settlement-form .form-row button {
  flex: 0 0 auto;
}

@media (max-width: 1380px) {
  .daily-card-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .app-shell,
  .dashboard-shell,
  .settlement-layout,
  .dashboard-grid,
  .layout-two,
  .form-page .form-grid,
  .metric-grid,
  .dashboard-metrics,
  .data-count-grid,
  .settlement-metrics,
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar input[name="q"] {
    min-width: 0;
  }

  .filter-form label {
    min-width: 0;
  }

  .daily-card-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .settlement-stats,
  .table-page-orders .settlement-summary .settlement-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell,
  .page,
  .login-shell {
    padding: 14px;
  }

  .card,
  .hero,
  .dashboard-filter,
  .dashboard-topbar,
  .brand-card {
    padding: 18px;
    border-radius: 22px;
  }

  .daily-card-strip {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .settlement-stats,
  .table-page-orders .settlement-summary .settlement-stats {
    grid-template-columns: 1fr;
  }
}


.return-cost-summary {
  display: grid;
  gap: 18px;
}

.return-cost-stats {
  align-items: stretch;
}

.return-cost-weekly .summary-table th,
.return-cost-weekly .summary-table td {
  white-space: nowrap;
}

.table-page-return_costs .toolbar {
  grid-template-columns: 160px minmax(220px, 1fr) 170px 170px 170px auto auto;
}

/* 基础设置：左侧固定宽度的新增表单列，右侧自适应的列表列。 */
.settings-block {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.settings-block > form {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-self: start;
}

.settings-block > section {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.settings-block .inline-import {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px dashed rgba(70, 52, 33, 0.16);
}

.settings-block .inline-import .form-stack {
  gap: 10px;
}

@media (max-width: 900px) {
  .settings-block {
    grid-template-columns: 1fr;
  }
  .settings-block > form,
  .settings-block > section {
    grid-column: 1;
    grid-row: auto;
  }
}

/* ============ 财务中心统一表格样式 ============ */
.fin-table {
  min-width: 720px;
}

.fin-table thead th {
  white-space: nowrap;
  font-size: 12px;
  padding: 10px 12px;
}

.fin-table td {
  font-size: 12.5px;
  line-height: 1.5;
  vertical-align: middle;
}

.fin-table td[data-col="_actions"],
.fin-table th[data-col="_actions"],
.fin-table .col-op {
  white-space: nowrap;
  text-align: center;
  width: 108px;
}

.fin-table .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
  display: inline-block;
}

.fin-table td[data-col="amount"],
.fin-table th[data-col="amount"],
.fin-table td[data-col="match_amount"],
.fin-table th[data-col="match_amount"],
.fin-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fin-table td[data-col="flow_direction"],
.fin-table th[data-col="flow_direction"] {
  text-align: center;
  width: 56px;
}

/* 收支记录表：为每列设定合理宽度，避免"编辑凭证"竖排、列过挤 */
.flow-table {
  min-width: 1160px;
}

.flow-table th[data-col="flow_date"],
.flow-table td[data-col="flow_date"] { width: 96px; white-space: nowrap; }
.flow-table th[data-col="category_one"],
.flow-table th[data-col="category_two"],
.flow-table th[data-col="department_name"],
.flow-table th[data-col="account_name"],
.flow-table th[data-col="handler_name"] { width: 104px; }
.flow-table th[data-col="amount"],
.flow-table td[data-col="amount"] { width: 96px; }
.flow-table th[data-col="note"] { width: 150px; }
.flow-table th[data-col="voucher_no"] { width: 90px; }
.flow-table th[data-col="remark"] { width: 110px; }
.flow-table td[data-col="category_one"],
.flow-table td[data-col="category_two"],
.flow-table td[data-col="department_name"],
.flow-table td[data-col="account_name"],
.flow-table td[data-col="note"],
.flow-table td[data-col="remark"] {
  white-space: normal;
  word-break: break-word;
}

/* 收/支 状态着色 */
.flow-table td[data-col="flow_direction"] { font-weight: 700; }

/* 基础设置列表表格 */
.settings-table { min-width: 0; }
.settings-table .col-num { width: 110px; }
.settings-table .col-dir { width: 64px; }
.settings-table .link-button.danger { font-size: 12px; }

/* ============ 收支记录筛选栏 ============ */
.fin-filter {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.fin-filter-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-filter-title::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 999px;
  background: var(--brand);
}

.fin-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fin-filter-fields select,
.fin-filter-fields input {
  width: auto;
  min-width: 150px;
  flex: 0 1 180px;
  padding: 9px 12px;
  border-radius: 12px;
}

/* ============ 财务仪表盘：营收概览与图表 ============ */
.rev-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.rev-mini {
  border-radius: 20px;
  padding: 18px 20px;
  color: #fff;
  box-shadow: var(--shadow);
  min-width: 0;
}

.rev-mini.today { background: linear-gradient(135deg, #eb7f2d, #d9691e); }
.rev-mini.week { background: linear-gradient(135deg, #1f8a70, #14684f); }
.rev-mini.month { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); }
.rev-mini.expense { background: linear-gradient(135deg, #7a6a57, #55483a); }

.rev-mini-label {
  font-size: 12px;
  opacity: 0.92;
  margin-bottom: 8px;
}

.rev-mini-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dashboard-filter .filter-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.chart-card .section-head {
  margin-bottom: 12px;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 190px;
  padding: 10px 4px 0;
  overflow-x: auto;
}

.trend-col {
  flex: 1 1 0;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
}

.trend-bar {
  width: 12px;
  border-radius: 6px 6px 0 0;
  display: block;
  transition: opacity 0.15s ease;
}

.trend-bar:hover { opacity: 0.8; }
.trend-bar.inc { background: linear-gradient(180deg, #f0913f, #e2732099); }
.trend-bar.exp { background: linear-gradient(180deg, #2c8f77, #14684f99); }

.trend-x {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.trend-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.trend-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.trend-legend .dot.inc { background: #eb7f2d; }
.trend-legend .dot.exp { background: #1f8a70; }

/* 各门店营收明细表 */
.dept-rev-table { min-width: 620px; }
.dept-rev-table .dept-name { font-weight: 600; }
.dept-rev-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dept-rev-table .num.strong { color: var(--brand); font-weight: 700; }
.dept-rev-table th:nth-child(2),
.dept-rev-table th:nth-child(3),
.dept-rev-table th:nth-child(4) { text-align: right; }
.dept-rev-table .bar-cell { width: 160px; }

.bar-track {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(21, 94, 117, 0.1);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #d9691e);
}

@media (max-width: 1200px) {
  .rev-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .rev-mini-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1280px) {
  .table-page-return_costs .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============ 财务仪表盘：账户余额模块组 ============ */
.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 244, 237, 0.85));
  border: 1px solid rgba(70, 52, 33, 0.1);
  display: grid;
  gap: 6px;
  align-content: start;
}

.account-card.total {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-color: transparent;
  color: #fff;
}

.account-card .account-name {
  font-size: 13px;
  font-weight: 700;
  color: #3d3226;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-card.total .account-name { color: #fff; }

.account-card .account-balance {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.account-card.total .account-balance { color: #fff; font-size: 24px; }

.account-card .account-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.account-card.total .account-meta { color: rgba(255, 255, 255, 0.9); }

.account-card .account-meta .inc { color: var(--success); }
.account-card .account-meta .exp { color: var(--danger); }
.account-card.total .account-meta .inc,
.account-card.total .account-meta .exp { color: #fff; }

.account-empty {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(70, 52, 33, 0.16);
}

@media (max-width: 1200px) {
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .account-grid { grid-template-columns: 1fr; }
}
