:root {
  color-scheme: light;
  --bg: #eef3f6;
  --bg-soft: #e6edf1;
  --surface: #ffffff;
  --surface-raised: #f8fafc;
  --surface-2: #e7f5f1;
  --text: #26323a;
  --text-strong: #0f172a;
  --muted: #667381;
  --muted-2: #8b99a8;
  --line: #d5dee7;
  --line-strong: #b8c5d1;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff6f1;
  --accent-2: #d97706;
  --accent-2-soft: #fff7e6;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warning-soft: #ffedd5;
  --sidebar: #111827;
  --sidebar-line: rgba(255, 255, 255, 0.10);
  --shadow: 0 22px 54px rgba(15, 23, 42, 0.13);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.07);
  --radius: 8px;
  --radius-sm: 6px;
  --control-height: 32px;
  --content-max: none;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.05), transparent 240px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
  font-size: 13px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: var(--accent-soft);
}

.login-page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.10), transparent 36%),
    var(--bg);
}

.login-panel {
  position: relative;
  width: calc(100vw - 48px);
  max-width: 420px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 224, 220, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

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

.login-panel h1 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 25px;
  line-height: 1.25;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-panel .btn {
  width: 100%;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.14), transparent 260px),
    var(--sidebar);
  color: #fff;
  padding: 18px 14px;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.brand {
  padding: 10px 10px 18px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
}

.brand span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  margin-top: 7px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav-group {
  display: grid;
  gap: 7px;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--sidebar-line);
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.nav-group.active .nav-group-title {
  color: #8ff4e6;
}

.nav-group-items {
  display: grid;
  gap: 6px;
  padding-left: 8px;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 10px 11px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
  cursor: grab;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.nav button::before {
  content: "";
  width: 3px;
  align-self: stretch;
  border-radius: 999px;
  background: transparent;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.nav button.active::before {
  background: #5eead4;
}

.nav button:active {
  cursor: grabbing;
  transform: translateY(1px);
}

.nav button.dragging {
  opacity: 0.42;
}

.nav .nav-group-title {
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav .nav-group-title::before {
  display: none;
}

.nav .nav-group-title:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav .nav-group-title:active {
  cursor: pointer;
}

.nav-group-caret {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.nav-group.collapsed .nav-group-caret {
  transform: rotate(-90deg);
}

.nav-empty {
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 13px;
}

.main {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 22px;
}

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

.topbar h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 26px;
  line-height: 1.2;
}

.announcement-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--accent-2-soft);
  border: 1px solid #f4cf9a;
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  color: #78350f;
  box-shadow: 0 1px 1px rgba(120, 53, 15, 0.04);
}

.announcement-bar strong {
  flex: 0 0 auto;
  font-weight: 800;
}

.announcement-bar span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.import-status {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: var(--radius);
  color: #1e3a8a;
}

.import-status strong,
.import-status span {
  display: block;
}

.import-status strong {
  font-weight: 800;
}

.import-status span {
  font-size: 13px;
}

.import-status-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: import-spin 0.8s linear infinite;
}

@keyframes import-spin {
  to {
    transform: rotate(360deg);
  }
}

.user-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

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

.stats {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

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

.stat {
  min-height: 104px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 3px solid transparent;
}

.stat:nth-child(1),
.stat:nth-child(2),
.stat:nth-child(3),
.stat:nth-child(4) {
  border-top-color: var(--accent);
}

.stat:nth-child(5),
.stat:nth-child(10) {
  border-top-color: var(--accent-2);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 10px;
  color: var(--text-strong);
  font-size: 27px;
  line-height: 1.05;
}

.dashboard-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.dashboard-detail-card {
  min-height: 176px;
}

.dashboard-detail-list {
  display: grid;
  gap: 8px;
}

.dashboard-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) max-content;
  gap: 6px 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-detail-row:last-child {
  border-bottom: 0;
}

.dashboard-detail-row strong,
.dashboard-detail-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-detail-row strong {
  color: var(--text-strong);
  font-size: 13px;
}

.dashboard-detail-row span {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-detail-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.shop-sales-panel {
  margin-top: 14px;
}

.chart-toolbar {
  align-items: center;
  justify-content: space-between;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8faf9;
}

.segmented-control button {
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  box-shadow: none;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
}

.shop-sales-chart {
  display: grid;
  gap: 10px;
}

.shop-sales-row {
  display: grid;
  grid-template-columns: minmax(130px, 210px) 1fr minmax(110px, max-content);
  align-items: center;
  gap: 10px;
}

.shop-sales-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-sales-bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efec;
}

.shop-sales-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #18a999);
}

.shop-sales-value {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.operation-date-filter {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.date-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-filter-field input {
  min-width: 148px;
}

.operation-overview-dashboard {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: #c9f4f1;
  box-shadow: inset 0 0 0 1px rgba(45, 188, 190, 0.16), 0 18px 42px rgba(30, 118, 128, 0.13);
}

.operation-overview-frame {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(194, 225, 235, 0.86);
  border-radius: var(--radius);
  background: #f8fcff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.07);
}

.operation-overview-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #4fd0cf;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
}

.operation-overview-titlebar div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.operation-overview-titlebar span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 900;
}

.operation-overview-titlebar strong {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-overview-titlebar .btn.primary {
  background: #fff;
  color: #157878;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.12);
}

.operation-overview-control-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e3edf5;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.05);
}

.operation-overview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.operation-overview-meta span,
.operation-overview-meta em {
  color: #7c8ca4;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.operation-overview-meta strong {
  color: #174ea6;
  font-size: 13px;
  font-weight: 900;
}

.operation-overview-dashboard .operation-date-filter {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid #edf3f8;
}

.operation-overview-dashboard .operation-overview-shop-filter {
  margin-top: 0;
  border-top-color: #edf3f8;
}

.operation-overview-dashboard .operation-overview-stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.operation-overview-dashboard .stat {
  min-height: 86px;
  padding: 12px;
  border: 1px solid #e3edf5;
  border-top: 0;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.06);
}

.operation-overview-dashboard .stat:nth-child(1) {
  background: #3287ff;
  border-color: #3287ff;
  color: #fff;
  box-shadow: 0 14px 26px rgba(50, 135, 255, 0.28);
}

.operation-overview-dashboard .stat:nth-child(4) {
  border-color: #dfe7ff;
  background: #fbfdff;
}

.operation-overview-dashboard .stat:nth-child(9) {
  border-color: #ffe0d6;
}

.operation-overview-dashboard .stat span {
  color: #75859d;
  font-size: 12px;
  font-weight: 900;
}

.operation-overview-dashboard .stat strong {
  margin-top: 8px;
  color: #18325f;
  font-size: 22px;
}

.operation-overview-dashboard .stat:nth-child(1) span,
.operation-overview-dashboard .stat:nth-child(1) strong {
  color: #fff;
}

.operation-analysis-grid,
.operation-chart-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.operation-analysis-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.operation-analysis-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.operation-analysis-card label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operation-analysis-card strong {
  display: block;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-analysis-note {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.operation-analysis-note.positive {
  color: var(--ok);
}

.operation-analysis-note.negative {
  color: var(--danger);
}

.operation-overview-dashboard .operation-analysis-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 0;
}

.operation-overview-dashboard .operation-analysis-card {
  min-height: 94px;
  padding: 11px 12px;
  border-color: #e3edf5;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.05);
}

.operation-overview-dashboard .operation-analysis-card label {
  color: #7b8ba3;
  font-size: 11px;
}

.operation-overview-dashboard .operation-analysis-card strong {
  color: #17366d;
  font-size: 18px;
}

.operation-chart-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.operation-chart-card {
  min-width: 0;
  margin-top: 0;
}

.operation-chart-card-wide {
  grid-column: 1 / -1;
}

.operation-overview-dashboard .operation-chart-grid {
  gap: 10px;
  margin-top: 0;
}

.operation-overview-dashboard .operation-chart-card {
  overflow: hidden;
  border-color: #e3edf5;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

.operation-overview-dashboard .chart-card-header {
  padding-bottom: 8px;
  border-bottom: 1px solid #edf3f8;
}

.operation-overview-dashboard .chart-card-header h3 {
  color: #17366d;
  font-size: 13px;
}

.chart-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.chart-card-header h3 {
  margin: 0;
}

.operation-trend-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(260px, 1.25fr) minmax(130px, 150px) minmax(130px, 150px) minmax(130px, 160px) minmax(110px, 140px);
  align-items: end;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8faf9;
}

.operation-overview-dashboard .operation-trend-controls {
  border-color: #e6eff8;
  background: #f7fbff;
}

.operation-overview-dashboard .segmented-control {
  border-color: #d8e6f4;
  background: #fff;
}

.operation-overview-dashboard .segmented-control button.active {
  background: #3287ff;
}

.trend-control-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trend-control-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trend-range-buttons {
  width: 100%;
  overflow-x: auto;
}

.trend-range-buttons button {
  white-space: nowrap;
}

.trend-range-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-shop-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.operation-overview-shop-filter {
  margin-top: 8px;
}

.operation-overview-shop-filter .trend-shop-options {
  max-height: 132px;
}

.trend-shop-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.trend-shop-picker-head > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trend-shop-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 104px;
  overflow-y: auto;
}

.trend-shop-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 190px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.trend-shop-option input {
  margin: 0;
}

.trend-shop-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.operation-line-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.chart-plot-bg {
  fill: #fbfdfc;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-axis-title,
.chart-series-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.chart-series-label {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}

.chart-area-payment {
  fill: url("#operation-payment-area");
}

.chart-point {
  stroke: var(--surface);
  stroke-width: 2px;
}

.chart-point.important {
  stroke-width: 2.4px;
}

.chart-point-hit {
  fill: transparent;
  cursor: crosshair;
}

.chart-annotation circle {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2px;
}

.chart-annotation text {
  fill: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
}

.chart-annotation.muted circle {
  stroke: var(--muted-2);
}

.chart-annotation.muted text {
  fill: var(--muted);
}

.operation-trend-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  align-items: stretch;
  gap: 12px;
}

.trend-summary-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
}

.trend-summary-row {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.trend-summary-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.trend-summary-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-summary-row strong {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-summary-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.trend-data-table {
  display: grid;
  gap: 0;
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.trend-data-head,
.trend-data-row {
  display: grid;
  grid-template-columns: minmax(86px, 1.1fr) repeat(5, minmax(76px, 1fr));
  align-items: center;
  gap: 8px;
  min-width: 560px;
  padding: 7px 10px;
}

.trend-data-head {
  background: #f4f8f6;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.trend-data-row {
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}

.trend-data-row strong {
  color: var(--text-strong);
}

.donut-layout {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.operation-donut {
  position: relative;
  width: 138px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(31, 37, 35, 0.08);
}

.operation-donut::after {
  content: "";
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.operation-donut-center {
  position: absolute;
  inset: 34px;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.operation-donut-center strong {
  max-width: 74px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-donut-center span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.operation-overview-dashboard .operation-donut {
  width: 132px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.10), 0 10px 18px rgba(37, 99, 235, 0.05);
}

.operation-overview-dashboard .operation-donut::after {
  background: #fff;
  box-shadow: 0 0 0 1px #e5edf6;
}

.operation-overview-bars {
  display: grid;
  gap: 10px;
}

.operation-overview-bar-row {
  display: grid;
  grid-template-columns: minmax(52px, 86px) minmax(110px, 1fr) 52px minmax(76px, max-content);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.operation-overview-bar-row span {
  overflow: hidden;
  color: #49627f;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.operation-overview-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.operation-overview-bar-row strong,
.operation-overview-bar-row em {
  color: #17366d;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.operation-overview-bar-row em {
  color: #7b8ba3;
}

.operation-overview-table-card {
  margin-top: 0;
  border-color: #e3edf5;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

.operation-overview-table-card .table-wrap {
  border-color: #e8f0f7;
}

.operation-overview-table-card table th {
  background: #f5f9ff;
  color: #5f728d;
}

.company-overview-panel {
  display: grid;
  gap: 14px;
}

.company-overview-stats {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

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

.company-overview-list {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5edf3;
  border-radius: var(--radius-sm);
  background: #fbfdfe;
}

.company-overview-list h4 {
  margin: 0 0 8px;
  color: #12325a;
  font-size: 14px;
}

.company-overview-list p {
  margin: 0;
  padding: 6px 0;
  border-top: 1px solid #eef3f7;
  color: #31506e;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.company-overview-list p:first-of-type {
  border-top: 0;
}

.company-overview-list strong {
  display: inline-block;
  margin-right: 6px;
  color: #0d746d;
}

.daily-report-ai-overview-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dbe7ef;
  border-left: 3px solid #0d746d;
  border-radius: var(--radius-sm);
  background: #fbfdfe;
}

.daily-report-ai-overview-summary strong {
  flex: 0 0 auto;
  color: var(--text-strong);
  font-size: 13px;
}

.daily-report-ai-overview-summary span {
  flex: 1 1 260px;
  min-width: 0;
  color: #31506e;
  font-size: 13px;
  line-height: 1.45;
}

.daily-report-ai-overview-summary em {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.company-overview-raw-details {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.company-overview-raw-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.company-overview-raw-details[open] summary {
  margin-bottom: 8px;
}

.chart-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chart-legend.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.chart-legend.compact span,
.legend-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend i,
.legend-name i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, max-content) 54px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.legend-row strong,
.legend-row em {
  color: var(--text-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.legend-row em {
  color: var(--muted);
}

.legend-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-comparison-panel {
  margin-top: 14px;
}

.staff-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.staff-comparison-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
}

.staff-comparison-title {
  margin-bottom: 10px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 900;
}

.staff-comparison-list {
  display: grid;
  gap: 9px;
}

.staff-comparison-row {
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr minmax(70px, max-content);
  align-items: center;
  gap: 8px;
}

.staff-comparison-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-comparison-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efec;
}

.staff-comparison-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #18a999);
}

.staff-comparison-row strong {
  color: var(--text-strong);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.compact-empty {
  padding: 16px 0;
}

.panel {
  padding: 12px;
  animation: panelFadeIn 0.16s ease both;
}

.compact-panel {
  padding: 9px 12px;
}

.panel + .panel,
.compact-panel + .panel,
.settings-subpage > .panel + .panel {
  margin-top: 10px;
}

.panel h3 {
  margin: 0 0 10px;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.3;
}

.subpage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.subpage-tabs button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 5px 9px;
  background: #eef2f0;
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.subpage-tabs button:hover {
  border-color: var(--line-strong);
  background: #f8faf9;
}

.subpage-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.toolbar h3 {
  margin-bottom: 0;
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  vertical-align: middle;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control span {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #dfe7e3;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.switch-control span::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 37, 35, 0.24);
  transition: transform 0.16s ease;
}

.switch-control input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-control input:checked + span::before {
  transform: translateX(20px);
}

.switch-control input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.switch-control input:disabled + span {
  cursor: wait;
  opacity: 0.72;
}

.binary-slider {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 76px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #eef3f0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  vertical-align: middle;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.binary-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 22px;
  border-radius: 999px;
  background: #64748b;
  box-shadow: 0 1px 3px rgba(31, 37, 35, 0.22);
  transition: transform 0.16s ease, background 0.16s ease;
}

.binary-slider.is-on {
  border-color: rgba(15, 118, 110, 0.5);
  background: #dff5ee;
}

.binary-slider.is-on::before {
  transform: translateX(36px);
  background: var(--accent);
}

.binary-slider-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  transition: color 0.16s ease;
}

.binary-slider.is-off .binary-slider-label-off,
.binary-slider.is-on .binary-slider-label-on {
  color: #fff;
}

.binary-slider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.binary-slider:disabled,
.binary-slider[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
}

.task-publication-table {
  table-layout: fixed;
  min-width: 1480px;
}

.task-publication-table th:nth-child(1),
.task-publication-table td:nth-child(1),
.task-publication-table th:nth-child(5),
.task-publication-table td:nth-child(5),
.task-publication-table th:nth-child(8),
.task-publication-table td:nth-child(8),
.task-publication-table th:nth-child(11),
.task-publication-table td:nth-child(11) {
  width: 92px;
}

.task-publication-table th:nth-child(4),
.task-publication-table td:nth-child(4) {
  width: 280px;
  white-space: normal;
  line-height: 1.45;
  word-break: break-word;
}

.task-publication-table .actions {
  min-width: 126px;
}

.test-record-form {
  margin-top: 0;
}

.test-record-table {
  table-layout: fixed;
  min-width: 1760px;
}

.test-record-table th,
.test-record-table td {
  vertical-align: top;
}

.test-record-table th:nth-child(1),
.test-record-table td:nth-child(1),
.test-record-table th:nth-child(2),
.test-record-table td:nth-child(2),
.test-record-table th:nth-child(3),
.test-record-table td:nth-child(3),
.test-record-table th:nth-child(4),
.test-record-table td:nth-child(4),
.test-record-table th:nth-child(6),
.test-record-table td:nth-child(6),
.test-record-table th:nth-child(7),
.test-record-table td:nth-child(7),
.test-record-table th:nth-child(13),
.test-record-table td:nth-child(13) {
  width: 126px;
}

.test-record-table th:nth-child(5),
.test-record-table td:nth-child(5) {
  width: 190px;
  white-space: normal;
  line-height: 1.45;
  word-break: break-word;
}

.test-record-table th:nth-child(8),
.test-record-table td:nth-child(8),
.test-record-table th:nth-child(9),
.test-record-table td:nth-child(9),
.test-record-table th:nth-child(10),
.test-record-table td:nth-child(10),
.test-record-table th:nth-child(11),
.test-record-table td:nth-child(11) {
  width: 92px;
}

.test-record-table th:nth-child(12),
.test-record-table td:nth-child(12) {
  width: 150px;
}

.test-record-table td:last-child {
  width: 88px;
}

.task-rich-field {
  gap: 0;
  align-self: stretch;
}

.task-rich-field > label {
  margin-bottom: 4px;
}

.task-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #f8faf9;
}

.task-rich-select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
}

.task-rich-tool {
  min-width: 36px;
  min-height: 32px;
  padding: 5px 9px;
  font-weight: 800;
}

.task-rich-color-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.task-rich-color {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.task-rich-image-button {
  color: var(--brand);
}

.task-rich-field .task-rich-editor {
  display: block;
  width: 100%;
  min-height: 132px;
  max-height: 280px;
  overflow: auto;
  border-radius: 0 0 7px 7px;
  border-top-color: var(--line);
  padding: 9px 10px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.task-rich-field .task-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.task-quill-field {
  gap: 0;
  align-self: stretch;
}

.task-quill-field > label {
  margin-bottom: 4px;
}

.task-quill-field .ql-toolbar.ql-snow {
  border-color: var(--line);
  border-radius: 7px 7px 0 0;
  background: #f8faf9;
}

.task-quill-field .ql-toolbar.ql-snow .ql-picker-label,
.task-quill-field .ql-toolbar.ql-snow .ql-picker-options,
.task-quill-field .ql-toolbar.ql-snow button {
  color: var(--text);
}

.task-quill-field .ql-container.ql-snow {
  min-height: 180px;
  border-color: var(--line);
  border-radius: 0 0 7px 7px;
  font-family: inherit;
}

.task-quill-field .ql-editor {
  min-height: 180px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.task-quill-field .ql-editor.ql-blank::before {
  color: var(--muted);
  font-style: normal;
}

.task-rich-editor ul,
.task-rich-editor ol,
.task-content-rich ul,
.task-content-rich ol {
  margin: 4px 0 4px 20px;
  padding: 0;
}

.task-rich-editor p,
.task-content-rich p {
  margin: 0 0 5px;
}

.task-rich-editor h2,
.task-content-rich h2 {
  margin: 2px 0 7px;
  font-size: 18px;
  line-height: 1.35;
}

.task-rich-editor h3,
.task-content-rich h3 {
  margin: 2px 0 6px;
  font-size: 15px;
  line-height: 1.4;
}

.task-rich-editor blockquote,
.task-content-rich blockquote {
  margin: 6px 0;
  padding: 6px 10px;
  border-left: 3px solid var(--brand);
  background: #f6fbfa;
  color: var(--muted);
}

.task-rich-editor img,
.task-quill-field .ql-editor img,
.task-content-rich img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 6px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.task-rich-editor a,
.task-quill-field .ql-editor a,
.task-content-rich a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.task-content-cell {
  vertical-align: top;
}

.task-content-rich {
  max-height: 150px;
  overflow: auto;
  line-height: 1.5;
}

.task-content-rich .ql-align-center {
  text-align: center;
}

.task-content-rich .ql-align-right {
  text-align: right;
}

.task-content-rich .ql-align-justify {
  text-align: justify;
}

.task-content-rich .ql-indent-1 { padding-left: 3em; }
.task-content-rich .ql-indent-2 { padding-left: 6em; }
.task-content-rich .ql-indent-3 { padding-left: 9em; }
.task-content-rich .ql-indent-4 { padding-left: 12em; }
.task-content-rich .ql-indent-5 { padding-left: 15em; }
.task-content-rich .ql-indent-6 { padding-left: 18em; }
.task-content-rich .ql-indent-7 { padding-left: 21em; }
.task-content-rich .ql-indent-8 { padding-left: 24em; }

.daily-report-form {
  display: grid;
  gap: 12px;
}

.daily-report-upload-form {
  display: grid;
  gap: 12px;
}

.daily-report-upload-form textarea {
  min-height: 260px;
  line-height: 1.55;
}

.daily-report-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.daily-report-form-actions {
  justify-content: flex-end;
}

.daily-report-list {
  display: grid;
  gap: 6px;
}

.daily-report-card {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: none;
}

.daily-report-compact-row {
  display: grid;
  grid-template-columns: minmax(155px, 0.72fr) minmax(420px, 2.4fr) 122px 112px;
  gap: 8px;
  align-items: center;
}

.daily-report-card-head {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.daily-report-card-head strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.2;
}

.daily-report-card-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.daily-report-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.daily-report-body {
  display: grid;
  gap: 10px;
}

.daily-report-content {
  max-width: 960px;
  max-height: 420px;
  overflow: auto;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.daily-report-content-details {
  grid-column: 3;
  grid-row: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  min-width: 0;
}

.daily-report-content-details summary {
  cursor: pointer;
  padding: 7px 9px;
  color: #0d746d;
  font-size: 12px;
  font-weight: 800;
  user-select: none;
  white-space: nowrap;
}

.daily-report-content-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.daily-report-content-details[open] {
  grid-column: 1 / -1;
  grid-row: 2;
}

.daily-report-content-details .daily-report-content {
  max-width: none;
  padding: 12px;
}

.daily-report-ai-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #dbe7ef;
  border-left: 3px solid #0d746d;
  border-radius: var(--radius-sm);
  background: #fbfdfe;
}

.daily-report-ai-panel.ai-good {
  border-left-color: #16a34a;
}

.daily-report-ai-panel.ai-normal {
  border-left-color: #0d746d;
}

.daily-report-ai-panel.ai-warning {
  border-left-color: #f59e0b;
}

.daily-report-ai-panel.ai-danger {
  border-left-color: #ef4444;
}

.daily-report-ai-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.daily-report-ai-line strong {
  flex: 0 0 auto;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1;
}

.daily-report-ai-line .tag {
  flex: 0 0 auto;
  padding: 3px 6px;
  font-size: 11px;
}

.daily-report-ai-verdict,
.daily-report-ai-flags,
.daily-report-ai-criteria {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-report-ai-flags span,
.daily-report-ai-criteria span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf7f5;
  color: #0d746d;
  font-size: 12px;
  font-weight: 700;
}

.daily-report-ai-criteria span.failed {
  background: #fff7ed;
  color: #9a3412;
}

.daily-report-ai-section-title {
  margin: 8px 0 4px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 900;
}

.daily-report-ai-review {
  margin: 6px 0;
  color: #31506e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.daily-report-ai-panel p {
  flex: 1 1 auto;
  min-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  color: #31506e;
  font-size: 12px;
  line-height: 1.35;
}

.daily-report-ai-panel ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #5b6f86;
  line-height: 1.45;
}

.daily-report-ai-more {
  margin-top: 6px;
}

.daily-report-ai-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-report-content p {
  margin: 0 0 7px;
}

.daily-report-card-actions {
  grid-column: 4;
  grid-row: 1;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 5px;
}

.daily-report-card-actions .btn {
  padding: 6px 8px;
  font-size: 12px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) minmax(140px, 200px) auto auto;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}

.search-input {
  flex: 1 1 280px;
}

.form-control,
.search-input,
.filter-select,
.filter-input,
.field input,
.field select,
.field textarea,
.item-row input,
.master-form input,
.employee-form input,
.employee-form select {
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 6px 9px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-control,
.search-input,
.filter-input,
.filter-select {
  width: 100%;
}

.form-control:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus,
.search-input:focus,
.filter-select:focus,
.filter-input:focus,
.item-row input:focus,
.master-form input:focus,
.employee-form input:focus,
.employee-form select:focus,
.inline-editor:focus {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field input::placeholder,
.field textarea::placeholder,
.search-input::placeholder,
.filter-input::placeholder,
.item-row input::placeholder {
  color: var(--muted-2);
}

.filter-select {
  flex: 0 1 180px;
}

.filter-input {
  flex: 0 1 160px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

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

.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
}

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

.readonly-field .readonly-value {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7faf8;
  color: var(--text);
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  align-self: center;
}

.field-permission-status {
  margin-top: 16px;
  min-width: 0;
  max-width: 100%;
}

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

.btn {
  min-height: var(--control-height);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: #e8eeeb;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  box-shadow: 0 1px 1px rgba(31, 37, 35, 0.04);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn:hover {
  background: #dde6e1;
  box-shadow: 0 5px 12px rgba(31, 37, 35, 0.08);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.warn {
  background: var(--warning-soft);
  color: #8a4a00;
}

.btn.warn:hover {
  background: #fed7aa;
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.danger:hover {
  background: #ffd4cf;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f8faf9;
  border-color: var(--line-strong);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5d1;
  border: 2px solid #fff;
  border-radius: 999px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f1;
  color: #37413d;
  font-weight: 800;
  white-space: nowrap;
}

th.sortable-th {
  padding: 0;
}

.sort-header {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 7px 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.sort-header:hover {
  background: #dfe9e5;
  color: var(--text-strong);
}

.sort-header.active {
  color: var(--accent-strong);
}

.sort-icon {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.sort-header.active .sort-icon {
  color: var(--accent-strong);
}

td {
  color: #29312e;
}

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

tbody tr:hover td {
  background: #f3faf7;
}

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

tbody tr.order-marked td {
  background: #fee2e2;
  color: #7f1d1d;
  border-bottom-color: #fecaca;
}

tbody tr.order-marked:hover td {
  background: #fecaca;
}

tr.order-pinned td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

tbody tr.order-marked td:first-child {
  box-shadow: inset 6px 0 0 #dc2626;
}

tbody tr.order-marked .order-no,
tbody tr.order-marked td:first-child {
  color: #991b1b;
  font-weight: 900;
}

.editable-cell {
  cursor: text;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.editable-cell:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #bdd7ec;
}

.editable-cell.is-saving {
  position: relative;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.24);
}

.editable-cell.is-saving::after {
  content: "保存中";
  position: absolute;
  right: 8px;
  top: 6px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.is-submitting {
  opacity: 0.78;
  pointer-events: none;
}

tbody tr td {
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.density-tight .panel {
  padding: 10px;
}

.density-tight th,
.density-tight td {
  padding: 6px 8px;
}

.private-traffic-calendar-panel {
  padding-bottom: 10px;
}

.private-traffic-month {
  width: auto;
  min-width: 150px;
}

.private-traffic-calendar-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.private-traffic-calendar {
  min-width: 900px;
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 1px;
  background: var(--line);
}

.private-traffic-weekday {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  background: #eef4f1;
  color: #46514d;
  font-size: 12px;
  font-weight: 900;
}

.private-traffic-day-empty,
.private-traffic-day {
  min-height: 92px;
  background: #fff;
}

.private-traffic-day {
  width: 100%;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 0;
  padding: 8px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.private-traffic-day:hover {
  background: #f3faf7;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.22);
}

.private-traffic-day:active {
  transform: translateY(1px);
}

.private-traffic-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.private-traffic-day-head strong {
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1;
}

.private-traffic-day-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.private-traffic-day-count {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.private-traffic-day-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

.traffic-kpi-chip {
  max-width: 100%;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.traffic-kpi-chip.met {
  background: var(--ok-soft);
  color: var(--ok);
}

.traffic-kpi-chip.muted {
  background: #eef2f0;
  color: var(--muted);
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inline-editor {
  width: 100%;
  min-width: 110px;
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.pin-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

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

.return-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.returns-table {
  width: 100%;
  min-width: 1745px;
  table-layout: fixed;
}

.returns-table-wrap {
  scroll-padding-right: 12px;
}

.returns-table th,
.returns-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.returns-table td:not(.return-note-cell):not(.return-detail-cell):not(.return-details-row-cell) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hma-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
}

.hma-table-wrap {
  scroll-padding-right: 12px;
}

.hma-table th,
.hma-table td {
  padding: 7px 9px;
  vertical-align: middle;
}

.hma-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hma-table .editable-cell {
  min-height: 30px;
}

.return-col-order {
  width: 170px;
}

.return-col-shipping {
  width: 140px;
}

.return-col-shop {
  width: 115px;
}

.return-col-type {
  width: 95px;
}

.return-col-after-sales-reason {
  width: 160px;
}

.return-col-time {
  width: 110px;
}

.return-col-product {
  width: 180px;
}

.return-col-logistics {
  width: 125px;
}

.return-col-date {
  width: 100px;
}

.return-col-amount {
  width: 80px;
}

.return-col-handler {
  width: 95px;
}

.return-col-note {
  width: 190px;
}

.return-col-detail {
  width: 75px;
}

.return-detail-cell {
  min-width: 75px;
}

.return-note-summary {
  display: grid;
  gap: 3px;
}

.return-notes-empty {
  color: var(--muted);
}

.return-after-sales-reason-cell {
  max-width: 160px;
}

.return-note-cell {
  min-width: 170px;
}

.return-note-cell-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.return-note-preview {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-note-button {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 6px 8px;
}

.return-note-modal-form {
  display: grid;
  gap: 10px;
}

.return-note-modal-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.return-note-modal-label {
  font-weight: 800;
}

.return-note-modal-textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.return-note-modal-textarea:focus {
  outline: 2px solid rgba(13, 148, 136, 0.16);
  border-color: var(--primary);
}

.return-detail-toggle {
  min-width: 56px;
  padding: 7px 10px;
}

.return-details-row td {
  border-top: 0;
}

.return-details-row-cell {
  padding: 0 10px 12px;
  overflow: visible;
  white-space: normal;
}

.return-detail-panel {
  margin: 0 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8faf9;
}

.return-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px 12px;
  padding: 10px;
}

.return-detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.return-detail-grid strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.return-detail-wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .returns-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .returns-table {
    display: block;
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .returns-table colgroup,
  .returns-table thead {
    display: none;
  }

  .returns-table tbody {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .returns-table tr {
    display: block;
    width: 100%;
  }

  .returns-table tr[data-return-id] {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 8px 10px;
  }

  .returns-table td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    width: 100%;
    padding: 7px 0;
    border-bottom: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .returns-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
  }

  .return-note-cell,
  .return-detail-cell,
  .return-details-row-cell {
    width: 100%;
  }

  .return-details-row {
    background: transparent;
  }

  .return-details-row td,
  .return-details-row-cell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .return-details-row td::before,
  .return-details-row-cell::before {
    content: none;
  }

  .return-detail-grid {
    grid-template-columns: 1fr;
  }
}

.fixed-filter-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8faf9;
  color: var(--text);
  font-size: 13px;
}

.shop-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfb;
}

.shop-filter-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logistics-cell {
  min-width: 180px;
  max-width: 260px;
  line-height: 1.55;
  color: #3d4a45;
}

.order-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8faf9;
}

.order-list-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.order-list-title strong {
  color: var(--text-strong);
  font-size: 15px;
}

.order-list-title span,
.order-people,
.order-meta-line {
  color: var(--muted);
  font-size: 12px;
}

.order-sort-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.order-sort-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.order-sort-button.active {
  border-color: rgba(15, 118, 110, 0.5);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.compact-order-head {
  margin-bottom: 8px;
}

.order-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 8px;
  border: 1px solid #dfe8ef;
  border-radius: var(--radius-sm);
  background: #fbfdfe;
}

.order-batch-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-strong);
  font-size: 13px;
}

.order-batch-summary span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.order-batch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.order-compact-wrap {
  max-height: none;
}

.order-compact-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
}

.order-col-select {
  width: 34px;
}

.order-col-id {
  width: 170px;
}

.order-col-items {
  width: 270px;
}

.order-col-address {
  width: 190px;
}

.order-col-money {
  width: 92px;
}

.order-col-time {
  width: 118px;
}

.order-col-logistics {
  width: 145px;
}

.order-col-people {
  width: 150px;
}

.order-col-status {
  width: 205px;
}

.order-col-actions {
  width: 115px;
}

.order-compact-table th,
.order-compact-table td {
  padding: 6px 7px;
  vertical-align: top;
  overflow: hidden;
}

.order-select-head,
.order-select-cell {
  text-align: center;
  vertical-align: middle;
}

.order-select-head input,
.order-select-cell input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.order-compact-id {
  overflow-wrap: anywhere;
}

.order-compact-items-cell,
.order-compact-address-cell {
  overflow-wrap: anywhere;
}

.order-compact-address-cell {
  vertical-align: top;
}

.order-compact-items {
  color: var(--text-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
  max-height: 34px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-compact-address {
  color: #33413b;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  max-height: 32px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  cursor: copy;
  transition: color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.order-compact-address:hover {
  color: var(--accent-strong);
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 rgba(15, 118, 110, 0.38);
}

.order-compact-address.copied {
  color: var(--ok);
  background: var(--ok-soft);
  box-shadow: inset 3px 0 0 var(--ok);
}

.order-compact-money {
  text-align: right;
}

.order-amount-head .sort-header {
  justify-content: flex-end;
  text-align: right;
}

.order-compact-money strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.order-compact-money.amount-paid strong {
  color: var(--ok);
  font-weight: 900;
}

.order-compact-money.amount-unpaid strong {
  color: var(--danger);
  font-weight: 900;
}

.order-compact-money small,
.order-compact-extra {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.order-compact-table .logistics-cell {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.order-compact-table .order-meta-line {
  gap: 3px 7px;
  font-size: 12px;
}

.order-compact-table .order-statuses {
  gap: 4px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.order-compact-table .tag {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 11px;
}

.order-compact-table .actions {
  gap: 4px;
}

.order-compact-table .order-people-cell {
  display: table-cell;
}

.order-compact-table .order-people {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
}

.order-compact-table .order-sales-person {
  max-width: 100%;
  min-height: 28px;
  padding: 3px 8px;
}

.order-compact-table .order-sales-person strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.order-card-list {
  display: grid;
  gap: 7px;
}

.order-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 37, 35, 0.04);
}

.order-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(31, 37, 35, 0.06);
}

.order-card.order-marked {
  background: #fee2e2;
  border-color: #dc2626;
  border-left: 6px solid #dc2626;
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.14);
}

.order-card.order-marked .order-no {
  color: #991b1b;
  font-weight: 900;
}

.order-card.order-pinned {
  border-left: 4px solid var(--accent);
}

.order-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px);
  align-items: start;
  gap: 12px;
}

.order-identity {
  min-width: 0;
}

.order-no {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.order-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 3px;
}

.order-meta-line span {
  min-width: 0;
}

.order-money {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

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

.order-money strong {
  color: var(--accent-strong);
  font-size: 17px;
  line-height: 1.1;
}

.order-money small {
  color: var(--muted);
}

.order-card-body {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(260px, 1.4fr) minmax(220px, 1fr) minmax(120px, 0.6fr);
  gap: 7px;
}

.order-info-block {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #edf1ef;
  border-radius: var(--radius-sm);
  background: #fbfcfb;
}

.order-info-block label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-info-block div {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #29312e;
  max-height: 46px;
  overflow: auto;
}

.order-item-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.order-item-line + .order-item-line {
  margin-top: 6px;
}

.order-item-line span {
  min-width: 0;
}

.order-item-line strong {
  flex: 0 0 auto;
  color: var(--text-strong);
}

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.order-statuses,
.order-people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.order-people {
  justify-content: flex-end;
}

.order-sales-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 6px;
  background: #ecfdf5;
  color: #134e4a;
}

.order-sales-person small {
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
}

.order-sales-person strong {
  color: #0f3d3a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

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

.btn.mini-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #edf0ff;
  color: #3730a3;
  white-space: nowrap;
}

.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.warn {
  background: var(--warning-soft);
  color: #9a3412;
}

.tag.status-done {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.status-pending {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.status-unpaid {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
  font-weight: 900;
}

.tag.return-status-returned {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag.return-status-normal {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.muted {
  background: #edf1ef;
  color: var(--muted);
}

.tag.permission-mode-edit,
.permission-mode-edit {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.permission-mode-readonly,
.permission-mode-readonly {
  background: #edf1ef;
  color: var(--muted);
}

.tag.permission-mode-hidden,
.permission-mode-hidden {
  background: var(--danger-soft);
  color: var(--danger);
}

.items-editor {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.items-editor strong {
  color: var(--text-strong);
}

.item-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(88px, 0.8fr) minmax(160px, 1.4fr);
  align-items: end;
  gap: 8px;
}

.item-row .field {
  min-width: 0;
}

.message {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: #115e59;
  margin-bottom: 12px;
}

.empty {
  min-height: 86px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.03), transparent),
    #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pagination .btn {
  min-height: 32px;
}

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

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  min-width: 0;
}

.settings-grid > .panel,
#field-permission-form {
  min-width: 0;
  max-width: 100%;
}

#field-permission-form .btn {
  width: 100%;
  min-width: 0;
}

.announcement-settings-panel {
  margin-bottom: 14px;
}

.debug-board-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 0;
  overflow: hidden;
}

details + details {
  margin-top: 10px;
}

summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--text-strong);
  font-weight: 800;
  background: #f7faf8;
  border-bottom: 1px solid transparent;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 800;
}

details[open] summary {
  border-bottom-color: var(--line);
}

details[open] summary::after {
  content: "-";
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.screenshot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.screenshot-list a {
  color: var(--accent);
  font-weight: 700;
}

.screenshot-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.screenshot-delete-btn {
  min-height: 24px;
  padding: 2px 6px;
}

.order-context-menu,
.page-context-menu {
  position: fixed;
  z-index: 60;
  width: 180px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.order-context-menu .context-title,
.page-context-menu .context-title {
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-context-menu button,
.page-context-menu button {
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.order-context-menu button:hover,
.page-context-menu button:hover {
  background: #eef4f1;
}

.order-context-menu button.danger,
.page-context-menu button.danger {
  color: var(--danger);
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.48);
}

.order-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 35;
}

.order-modal {
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: 0 28px 78px rgba(15, 23, 42, 0.24);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.modal-head h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.order-modal #order-form,
.business-modal #kdzs-sync-form,
.business-modal #order-subpage-form,
.business-modal #brushing-form,
.business-modal #private-order-form,
.business-modal #return-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 18px;
}

.order-modal #order-form > h3,
.business-modal #kdzs-sync-form > h3,
.business-modal #order-subpage-form > h3,
.business-modal #brushing-form > h3,
.business-modal #private-order-form > h3,
.business-modal #return-form > h3 {
  display: none;
}

.alipay-qr-card {
  width: min(480px, calc(100vw - 36px));
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.alipay-qr-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.alipay-qr-box {
  display: grid;
  gap: 10px;
  justify-items: center;
  color: #075985;
}

.qr-grid {
  width: 150px;
  aspect-ratio: 1;
  border: 8px solid #0ea5e9;
  background:
    linear-gradient(90deg, #0f172a 10px, transparent 10px) 0 0 / 30px 30px,
    linear-gradient(#0f172a 10px, transparent 10px) 0 0 / 30px 30px,
    #f8fafc;
}

.payment-qr-image {
  width: 150px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.alipay-qr-meta {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.alipay-qr-meta div {
  display: grid;
  gap: 4px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.alipay-qr-meta div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.alipay-qr-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.alipay-qr-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.confirm-dialog {
  width: min(390px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 18px;
}

.confirm-dialog p {
  margin: 0 0 16px;
  color: var(--muted);
}

.urgent-reminder-table {
  min-width: 1120px;
}

.urgent-reminder-table .message-cell {
  max-width: 520px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.urgent-reminder-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.56);
}

.urgent-reminder-alert {
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: #fff;
  box-shadow: 0 28px 78px rgba(15, 23, 42, 0.32);
}

.urgent-reminder-pulse {
  width: 62px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 26%, var(--danger-soft) 27% 58%, rgba(180, 35, 24, 0.18) 59% 100%);
  position: relative;
}

.urgent-reminder-pulse::after {
  content: "!";
  position: absolute;
  inset: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.urgent-reminder-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.urgent-reminder-eyebrow {
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
}

.urgent-reminder-alert h3,
.urgent-reminder-alert p {
  margin: 0;
}

.urgent-reminder-alert h3 {
  color: var(--text-strong);
  font-size: 18px;
}

.urgent-reminder-alert p {
  color: var(--text);
  overflow-wrap: anywhere;
}

.urgent-reminder-meta {
  color: var(--muted);
  font-size: 12px;
}

.urgent-reminder-reply {
  min-height: 72px;
  resize: vertical;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

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

  .operation-chart-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

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

  .operation-trend-controls {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .search-form {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) minmax(130px, 180px);
  }

  .search-form .btn {
    width: 100%;
  }

  .order-card-body {
    grid-template-columns: minmax(260px, 1fr) minmax(240px, 1fr);
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

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

  .nav-group {
    grid-column: 1 / -1;
  }

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

  .main {
    padding: 16px;
  }

  .stats,
  .settings-grid,
  .operation-chart-grid,
  .company-overview-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-box {
    justify-content: flex-start;
  }

  .check-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .search-form {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .btn,
  .subpage-tabs button {
    flex: 1 1 auto;
  }

  .date-filter-field,
  .date-filter-field input {
    width: 100%;
  }

  .operation-trend-controls {
    grid-template-columns: 1fr;
  }

  .trend-range-buttons {
    display: flex;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .operation-overview-titlebar {
    align-items: stretch;
    flex-direction: column;
  }

  .operation-overview-titlebar .btn {
    width: 100%;
  }

  .operation-overview-bar-row {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .operation-overview-bar-row span,
  .operation-overview-bar-track,
  .operation-overview-bar-row em {
    grid-column: 1 / -1;
  }

  .daily-report-meta-grid {
    grid-template-columns: 1fr;
  }

  .daily-report-compact-row {
    grid-template-columns: 1fr;
  }

  .daily-report-card-head,
  .daily-report-ai-panel,
  .daily-report-content-details,
  .daily-report-content-details[open],
  .daily-report-card-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .daily-report-card-actions {
    justify-content: flex-start;
  }

  .donut-layout .chart-legend {
    width: 100%;
  }

  .alipay-qr-body {
    grid-template-columns: 1fr;
  }

  .order-list-head,
  .order-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .order-card-main,
  .order-card-body {
    grid-template-columns: 1fr;
  }

  .order-sort-strip,
  .order-money,
  .order-people {
    justify-content: flex-start;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 12px;
  }

  .topbar h2 {
    font-size: 23px;
  }

  .login-panel {
    width: calc(100vw - 32px);
    max-width: 340px;
    padding: 24px;
  }

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

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

  .order-modal-backdrop {
    align-items: flex-start;
    padding: 10px;
  }

  .order-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .user-box {
    flex-wrap: wrap;
  }

  .actions {
    min-width: 0;
  }
}

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

  .nav-group-items {
    grid-template-columns: 1fr;
  }
}

/* Mujing 2026 visual refresh. Keep this layer at the end so business CSS contracts stay intact. */
html {
  background: var(--bg);
  scrollbar-color: #a8b5c1 transparent;
}

body {
  min-height: 100dvh;
  background:
    linear-gradient(180deg, #f8fbfd 0, #eef3f6 360px),
    var(--bg);
  font-size: 13px;
  line-height: 1.48;
}

body,
button,
input,
select,
textarea {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--accent-strong);
  font-weight: 700;
}

button,
.btn,
summary,
[data-action],
[data-view] {
  touch-action: manipulation;
}

.login-page {
  min-height: 100dvh;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(150deg, rgba(15, 118, 110, 0.13) 0, transparent 38%),
    linear-gradient(330deg, rgba(30, 58, 138, 0.10) 0, transparent 40%),
    #edf3f6;
}

.login-panel {
  max-width: 438px;
  padding: 32px;
  border-color: rgba(184, 197, 209, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}

.login-panel::before {
  height: 5px;
  background: linear-gradient(90deg, var(--accent), #1e3a8a 58%, var(--accent-2));
}

.login-panel h1 {
  font-size: 27px;
  letter-spacing: 0;
}

.login-panel p {
  line-height: 1.6;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  padding: 16px 12px;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.12), transparent 300px),
    linear-gradient(0deg, rgba(30, 58, 138, 0.10), transparent 360px),
    var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.34);
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid var(--sidebar);
  background: rgba(203, 213, 225, 0.28);
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 10px 10px 16px;
}

.brand::before {
  content: "";
  grid-row: 1 / 3;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: url("/static/mujing-whale.svg") center / cover no-repeat;
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.18);
}

.brand strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  grid-column: 2;
  margin-top: 0;
  color: rgba(226, 232, 240, 0.72);
}

.nav {
  gap: 8px;
  margin-top: 14px;
}

.nav-group {
  gap: 6px;
  padding: 5px 0 12px;
}

.nav-group-title,
.nav button {
  min-height: 38px;
  border-radius: 7px;
}

.nav-group-title {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(248, 250, 252, 0.94);
  letter-spacing: 0;
}

.nav-group.active .nav-group-title {
  color: #99f6e4;
  background: rgba(20, 184, 166, 0.13);
}

.nav-group-items {
  gap: 5px;
  padding-left: 6px;
}

.nav button {
  padding: 9px 10px;
  color: rgba(226, 232, 240, 0.74);
  cursor: grab;
}

.nav button::before {
  width: 3px;
  border-radius: 999px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #f8fafc;
}

.nav button.active {
  box-shadow: inset 0 0 0 1px rgba(153, 246, 228, 0.10);
}

.nav button.active::before {
  background: #2dd4bf;
}

.main {
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  align-items: center;
  margin: -22px -22px 16px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(213, 222, 231, 0.92);
  background: rgba(248, 251, 253, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.topbar h2 {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
}

.user-box {
  gap: 8px;
  color: #536170;
}

.announcement-bar,
.import-status,
.message {
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.announcement-bar {
  background: #fff7e6;
  border-color: #f6d79c;
  border-left-color: var(--accent-2);
}

.import-status {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: #2563eb;
}

.grid {
  gap: 12px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.stat,
.panel {
  border-color: rgba(213, 222, 231, 0.96);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 14px;
}

.panel h3 {
  margin-bottom: 11px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 900;
}

.panel + .panel,
.compact-panel + .panel,
.settings-subpage > .panel + .panel {
  margin-top: 12px;
}

.stat {
  min-height: 102px;
  padding: 15px;
  border-top: 0;
  box-shadow:
    inset 0 3px 0 var(--accent),
    var(--shadow-soft);
}

.stat:nth-child(5),
.stat:nth-child(10) {
  box-shadow:
    inset 0 3px 0 var(--accent-2),
    var(--shadow-soft);
}

.stat span {
  color: #64748b;
  font-size: 12px;
  letter-spacing: 0;
}

.stat strong {
  margin-top: 9px;
  color: #0f172a;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.toolbar {
  gap: 8px;
  margin-bottom: 10px;
}

.toolbar h3 {
  font-size: 16px;
}

.subpage-tabs {
  gap: 7px;
  margin-bottom: 10px;
}

.subpage-tabs button,
.segmented-control button,
.trend-shop-option {
  font-weight: 800;
}

.subpage-tabs button {
  min-height: 32px;
  border-color: #dbe4ec;
  border-radius: 7px;
  background: #f8fafc;
  color: #3f4c59;
}

.subpage-tabs button:hover {
  background: #eef6f4;
  border-color: #bedad4;
}

.subpage-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.20);
}

.segmented-control {
  gap: 3px;
  padding: 3px;
  border-color: #d5dee7;
  border-radius: 7px;
  background: #edf3f6;
}

.segmented-control button {
  min-height: 29px;
  border-radius: 5px;
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
}

.form-control,
.search-input,
.filter-select,
.filter-input,
.field input,
.field select,
.field textarea,
.item-row input,
.master-form input,
.employee-form input,
.employee-form select,
.inline-editor {
  min-height: 34px;
  border-color: #cfd9e3;
  border-radius: 7px;
  background: #ffffff;
  color: #1f2a37;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.field label,
.trend-control-field span,
.date-filter-field,
.form-hint,
.muted-text {
  color: #64748b;
}

.field label,
.trend-control-field span {
  font-size: 12px;
  font-weight: 800;
}

.form-control:hover,
.search-input:hover,
.filter-select:hover,
.filter-input:hover,
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #aebdca;
  background: #fbfdff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-control:focus,
.search-input:focus,
.filter-select:focus,
.filter-input:focus,
.item-row input:focus,
.master-form input:focus,
.employee-form input:focus,
.employee-form select:focus,
.inline-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.readonly-field .readonly-value {
  min-height: 34px;
  border-color: #d8e1ea;
  border-radius: 7px;
  background: #f8fafc;
}

.search-form {
  grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) minmax(150px, 210px) auto auto;
  gap: 8px;
}

.form-grid {
  gap: 9px;
}

.btn {
  min-height: 34px;
  border-radius: 7px;
  padding: 6px 11px;
  background: #e8eef4;
  color: #24313d;
  font-weight: 800;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.05);
}

.btn:hover {
  background: #dfe7ef;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn.primary {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.btn.primary:hover {
  background: #0b5f59;
}

.btn.ghost {
  border-color: #cfd9e3;
  background: rgba(255, 255, 255, 0.74);
  color: #334155;
}

.btn.ghost:hover {
  background: #ffffff;
  border-color: #aebdca;
}

.btn.warn {
  background: #fff7e6;
  color: #92400e;
  border-color: #f5d596;
}

.btn.warn:hover {
  background: #ffedd5;
}

.btn.danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn.danger:hover {
  background: #fecaca;
}

.btn:disabled,
.pagination .btn:disabled {
  opacity: 0.46;
}

.table-wrap {
  border-color: #d5dee7;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.table-wrap::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid #f1f5f9;
  background: #9caebf;
}

table {
  background: #fff;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 8px 10px;
  border-bottom-color: #e2e8f0;
}

th {
  top: 0;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  letter-spacing: 0;
  box-shadow: inset 0 -1px 0 #dbe4ec;
}

td {
  color: #26323a;
}

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

tbody tr:hover td {
  background: #eef8f5;
}

.sort-header {
  min-height: 35px;
  padding: 8px 10px;
}

.sort-header:hover {
  background: #e4ebef;
}

.sort-header.active,
.sort-header.active .sort-icon {
  color: #0f766e;
}

.editable-cell:hover {
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.20);
}

.tag {
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e8eefb;
  color: #3730a3;
  font-size: 12px;
  font-weight: 900;
}

.tag.ok,
.tag.status-done,
.tag.return-status-normal,
.tag.permission-mode-edit,
.permission-mode-edit {
  background: #dcfce7;
  color: #166534;
}

.tag.warn {
  background: #ffedd5;
  color: #9a3412;
}

.tag.status-pending,
.tag.status-unpaid,
.tag.return-status-returned,
.tag.permission-mode-hidden,
.permission-mode-hidden {
  background: #fee2e2;
  color: #991b1b;
}

.tag.muted,
.tag.permission-mode-readonly,
.permission-mode-readonly {
  background: #edf2f7;
  color: #64748b;
}

.message {
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: #ecfdf5;
  color: #115e59;
}

.empty {
  min-height: 92px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.035), transparent),
    #fff;
  color: #64748b;
}

.pagination {
  gap: 8px;
}

.shop-sales-bar-track,
.staff-comparison-track,
.operation-overview-bar-track {
  background: #e2e8f0;
}

.shop-sales-bar,
.staff-comparison-track i,
.operation-overview-bar-track i {
  background: linear-gradient(90deg, #0f766e, #2563eb);
}

.staff-comparison-card,
.operation-analysis-card,
.trend-summary-panel,
.order-info-block {
  border-color: #dbe4ec;
  border-radius: var(--radius);
  background: #fbfdff;
}

.staff-comparison-title,
.order-list-title strong,
.order-no {
  color: #0f172a;
}

.operation-overview-dashboard {
  padding: 12px;
  border-color: #cfe1ee;
  background: #f1f8fb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86), 0 20px 46px rgba(15, 23, 42, 0.08);
}

.operation-overview-frame {
  gap: 12px;
  padding: 12px;
  border-color: #d8e7f0;
  background: #ffffff;
}

.operation-overview-titlebar {
  min-height: 52px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f766e, #1e3a8a);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.18);
}

.operation-overview-titlebar .btn.primary {
  background: #ffffff;
  color: #0f5f59;
}

.operation-overview-control-panel,
.operation-overview-dashboard .stat,
.operation-overview-dashboard .operation-analysis-card,
.operation-overview-dashboard .operation-chart-card {
  border-color: #d8e7f0;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.operation-overview-dashboard .stat:nth-child(1) {
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.operation-overview-dashboard .stat strong,
.operation-overview-dashboard .operation-analysis-card strong,
.operation-overview-dashboard .chart-card-header h3 {
  color: #123052;
}

.operation-overview-dashboard .segmented-control button.active {
  background: #0f766e;
}

.operation-overview-dashboard .operation-trend-controls,
.operation-trend-controls {
  border-color: #d5dee7;
  border-radius: var(--radius);
  background: #f8fafc;
}

.operation-chart-card,
.operation-overview-table-card {
  overflow: hidden;
}

.line-chart-wrap,
.returns-table-wrap {
  scrollbar-color: #9caebf #f1f5f9;
}

.chart-plot-bg {
  fill: #ffffff;
}

.chart-grid-line {
  stroke: #dbe4ec;
}

.chart-axis-line {
  stroke: #b8c5d1;
}

.order-list-head,
.order-batch-toolbar {
  border-color: #d5dee7;
  border-radius: var(--radius);
  background: #f8fafc;
}

.order-batch-toolbar {
  padding: 10px 12px;
}

.order-card-list {
  gap: 9px;
}

.order-card {
  padding: 12px;
  border-color: #d5dee7;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.order-card:hover {
  border-color: #adc1ce;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.order-card.order-pinned {
  border-left-color: var(--accent);
}

.order-card.order-marked {
  border-color: #ef4444;
  border-left-color: #dc2626;
  background: #fff1f2;
}

.order-money strong,
.order-compact-money strong {
  color: #0f766e;
}

.order-compact-money.amount-paid strong {
  color: #15803d;
}

.order-compact-money.amount-unpaid strong {
  color: #b91c1c;
}

.order-sales-person {
  border-color: rgba(15, 118, 110, 0.28);
  border-radius: 7px;
  background: #ecfdf5;
}

.return-detail-panel {
  border-color: #dbe4ec;
  border-radius: var(--radius);
  background: #f8fafc;
}

.return-detail-grid span {
  color: #64748b;
}

.return-detail-grid strong {
  color: #1f2a37;
}

.daily-report-card,
.company-overview-panel,
.private-traffic-calendar-panel {
  border-color: #d5dee7;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.daily-report-card {
  padding: 13px;
}

.daily-report-card-head strong {
  color: #0f172a;
}

.daily-report-ai-panel {
  border-radius: var(--radius);
}

.daily-report-ai-panel.ai-good {
  background: #ecfdf5;
}

.daily-report-ai-panel.ai-warning,
.daily-report-ai-panel.ai-danger {
  background: #fff7ed;
}

.daily-report-content-details summary,
.company-overview-raw-details summary,
summary {
  color: #475569;
}

.task-quill-field .ql-toolbar.ql-snow,
.task-quill-field .ql-container.ql-snow,
.task-rich-field .task-rich-editor {
  border-color: #d5dee7;
}

.task-quill-field .ql-toolbar.ql-snow {
  background: #f8fafc;
  border-radius: var(--radius) var(--radius) 0 0;
}

.task-quill-field .ql-container.ql-snow {
  border-radius: 0 0 var(--radius) var(--radius);
}

.private-traffic-day {
  border-color: #dbe4ec;
  border-radius: var(--radius);
}

.private-traffic-day:hover {
  border-color: #9ecdc5;
  background: #f0fdfa;
}

.traffic-kpi-chip {
  border-radius: 999px;
}

.order-context-menu,
.page-context-menu,
.confirm-dialog,
.alipay-qr-card,
.order-modal,
.urgent-reminder-alert {
  border-color: rgba(213, 222, 231, 0.94);
  border-radius: var(--radius);
  box-shadow: 0 28px 78px rgba(15, 23, 42, 0.22);
}

.order-context-menu,
.page-context-menu {
  padding: 7px;
}

.order-context-menu button,
.page-context-menu button {
  border-radius: 6px;
}

.order-context-menu button:hover,
.page-context-menu button:hover {
  background: #eef8f5;
}

.confirm-backdrop,
.order-modal-backdrop,
.urgent-reminder-backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-head {
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.modal-head h3,
.confirm-dialog h3 {
  color: #0f172a;
  font-weight: 900;
}

.switch-control span {
  border-color: #b8c5d1;
  background: #dbe4ec;
}

.switch-control input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.urgent-reminder-alert {
  background: #fff;
}

.urgent-reminder-pulse {
  background: radial-gradient(circle, #fff 0 26%, #fee2e2 27% 58%, rgba(185, 28, 28, 0.18) 59% 100%);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.is-submitting,
.is-saving {
  cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

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

  .main {
    padding: 18px;
  }

  .topbar {
    margin: -18px -18px 14px;
    padding: 13px 18px;
  }

  .search-form {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 210px) minmax(130px, 180px);
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    max-height: min(52dvh, 440px);
    overflow-y: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

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

  .topbar {
    margin: -16px -16px 14px;
    padding: 13px 16px;
  }

  .topbar h2 {
    font-size: 21px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .user-box,
  .toolbar,
  .order-batch-actions,
  .daily-report-card-actions {
    justify-content: flex-start;
  }

  .search-form,
  .operation-trend-controls,
  .form-grid,
  .item-row {
    grid-template-columns: 1fr;
  }

  .btn,
  .form-control,
  .search-input,
  .filter-select,
  .filter-input,
  .field input,
  .field select,
  .field textarea {
    min-height: 40px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .panel,
  .stat,
  .order-card,
  .daily-report-card {
    padding: 12px;
  }

  th,
  td {
    padding: 8px;
  }
}

@media (max-width: 420px) {
  .login-panel {
    width: calc(100vw - 28px);
    padding: 24px;
  }

  .brand {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brand::before {
    width: 38px;
  }
}

/* Long confirmation messages keep actions reachable. */
.confirm-backdrop {
  align-items: center;
  justify-items: center;
  overflow: auto;
  padding: 18px;
}

.confirm-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(460px, calc(100vw - 36px));
  max-height: min(78dvh, 680px);
  overflow: hidden;
  padding: 0;
}

.confirm-dialog-head {
  padding: 18px 18px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.confirm-dialog h3 {
  margin: 0;
}

.confirm-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 18px;
  scrollbar-color: #9caebf #f1f5f9;
}

.confirm-dialog-body::-webkit-scrollbar {
  width: 10px;
}

.confirm-dialog-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.confirm-dialog-body::-webkit-scrollbar-thumb {
  border: 3px solid #f1f5f9;
  border-radius: 999px;
  background: #9caebf;
}

.confirm-dialog p {
  margin: 0;
  color: #475569;
  line-height: 1.56;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.confirm-dialog-actions .btn {
  min-width: 78px;
}

@media (max-width: 560px) {
  .confirm-backdrop {
    padding: 12px;
  }

  .confirm-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .confirm-dialog-actions {
    justify-content: stretch;
  }

  .confirm-dialog-actions .btn {
    flex: 1 1 0;
    min-height: 44px;
  }
}
