:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #172033;
  --muted: #697586;
  --line: #d7dee8;
  --primary: #1769d2;
  --primary-dark: #1457ad;
  --primary-2: #e7f0ff;
  --green: #108548;
  --green-bg: #e6f6ee;
  --amber: #a65f00;
  --amber-bg: #fff3d8;
  --red: #b42318;
  --red-bg: #fee4e2;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, #f7f9fc 0, #eef3f7 260px, #eef3f7 100%);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

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

.checkbox-dragging {
  user-select: none;
  cursor: pointer;
}

button {
  border: 0;
  cursor: pointer;
}

.sync-status-card {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.sync-status-main,
.sync-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.sync-status-main {
  margin-bottom: 8px;
}

.sync-status-main strong {
  font-size: 13px;
}

.sync-status-main span,
.sync-status-meta {
  color: var(--muted);
}

.sync-status-error {
  margin-top: 8px;
  color: var(--red);
}

.settings-accordion {
  display: grid;
  gap: 12px;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.settings-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #f8fbff;
  color: var(--text);
  border-bottom: 1px solid transparent;
  text-align: left;
}

.settings-section.open .settings-section-head {
  border-bottom-color: var(--line);
}

.settings-section-head span {
  display: grid;
  gap: 3px;
}

.settings-section-head strong {
  font-size: 14px;
}

.settings-section-head em,
.settings-section-head small {
  font-style: normal;
  color: var(--muted);
}

.settings-section-head::after {
  content: "展开";
  color: var(--primary);
  font-weight: 700;
}

.settings-section.open .settings-section-head::after {
  content: "收起";
}

.settings-section-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.source-map-form .source-map-list {
  display: grid;
  gap: 8px;
}

.source-map-row {
  display: grid;
  grid-template-columns: 120px minmax(150px, 1fr) minmax(180px, 1.1fr) minmax(120px, .8fr) minmax(120px, .8fr) 90px minmax(120px, .8fr) 72px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.source-map-row .field {
  margin: 0;
}

.source-map-actions .btn {
  width: 100%;
}

@media (max-width: 1200px) {
  .source-map-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.wechat-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--line);
  background: #f3f6fb;
  color: var(--primary);
  font-weight: 700;
}

.wechat-avatar.placeholder {
  background: #e7f0ff;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 22% 18%, rgba(23, 105, 210, 0.14), transparent 32%),
    linear-gradient(135deg, #eef3f9 0%, #f8fafc 54%, #eef7f1 100%);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 22px 60px rgba(21, 35, 54, 0.14);
}

.login-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 8px;
  text-align: center;
}

.login-brand img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.login-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  text-align: center;
}

.login-tips {
  margin-top: 16px;
  padding: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.8;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #17202c 0%, #101923 100%);
  color: #eef4fb;
  padding: 18px 12px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 0 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
}

.brand span {
  line-height: 1.25;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  min-height: 40px;
  padding: 10px 12px;
  color: #b9c6d6;
  background: transparent;
  border-radius: 7px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-button.active,
.nav-button:hover {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(23, 105, 210, 0.95), rgba(23, 105, 210, 0.72));
  box-shadow: 0 8px 18px rgba(23, 105, 210, 0.18);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3600;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.content {
  position: relative;
  z-index: 1;
  padding: 20px 20px 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 16px 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(21, 35, 54, 0.06);
}

.hero-stat::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(23, 105, 210, 0.08);
}

.accent-stat {
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  border-color: #c8dcfb;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
}

.stat.compact .stat-value {
  font-size: 20px;
}

.stat-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

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

.action-panel {
  grid-column: 1 / -1;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  color: var(--text);
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}

.quick-action:hover {
  border-color: #b7cff5;
  box-shadow: 0 10px 22px rgba(23, 105, 210, 0.08);
}

.quick-action span {
  color: var(--muted);
  font-size: 10px;
}

.bar-list,
.rank-list,
.todo-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-meta span {
  color: var(--muted);
  font-size: 10px;
}

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

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

.green-fill {
  background: linear-gradient(90deg, var(--green), #45c081);
}

.status-chart {
  min-height: 178px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 12px;
}

.status-bar {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.status-label,
.status-count {
  color: var(--muted);
  font-size: 10px;
}

.status-column {
  height: 128px;
  width: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}

.status-column span {
  width: 100%;
  display: block;
  background: linear-gradient(180deg, #58a6ff, var(--primary));
  border-radius: 999px 999px 0 0;
}

.rank-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
}

.rank-list-folded {
  gap: 8px;
}

.rank-department {
  border: 1px solid #dbe6f5;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.rank-department summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--text);
  background: #f6f9fd;
  cursor: pointer;
  list-style: none;
}

.rank-department summary::-webkit-details-marker {
  display: none;
}

.rank-department summary::before {
  content: "›";
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
  transition: transform 0.16s ease;
}

.rank-department[open] summary::before {
  transform: rotate(90deg);
}

.rank-department summary strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-department summary span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.rank-department summary:hover,
.rank-department summary:focus {
  color: var(--primary);
  background: #eaf3ff;
  outline: none;
}

.rank-department-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.rank-no {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1f2a3d;
  border-radius: 999px;
  font-weight: 700;
}

.rank-main {
  min-width: 0;
}

.todo-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.todo-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.todo-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
}

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

.blue-dot {
  background: var(--primary);
}

.red-dot {
  background: var(--red);
}

.panel {
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(21, 35, 54, 0.055);
  overflow: hidden;
}

.panel:has(.order-filter),
.panel:has(.choice-select.open),
.panel:has(.tag-filter.open) {
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.panel-body {
  padding: 12px;
}

.inline-form {
  background: #fff;
}

.form-section-title {
  margin: 6px 0 12px;
  padding-left: 9px;
  color: var(--text);
  border-left: 3px solid var(--primary);
  font-weight: 700;
}

.form-section-title:not(:first-child) {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

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

.dashboard-notice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.range-tab {
  min-height: 26px;
  padding: 4px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
}

.range-tab.active {
  color: #ffffff;
  background: var(--primary);
}

.batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  background: #f5f9ff;
  border: 1px solid #c8dcfb;
  border-radius: 7px;
}

.batch-toolbar-left,
.batch-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.batch-toolbar-right {
  margin-left: auto;
}

.batch-toolbar span {
  color: var(--primary);
  font-weight: 700;
}

.batch-toolbar .batch-toolbar-hint {
  color: #64748b;
  font-weight: 500;
}

.followup-customer-link {
  font-weight: 700;
}

.compact-select {
  min-height: 26px;
  max-width: 150px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.followup-accordion {
  display: grid;
  gap: 8px;
}

.followup-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.followup-item summary {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) 120px 90px minmax(180px, 2fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

.followup-item summary::-webkit-details-marker {
  display: none;
}

.followup-item summary span,
.followup-item summary em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-item summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.followup-item summary em {
  color: var(--muted);
  font-style: normal;
}

.followup-detail {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #f8fbff;
}

.followup-detail p {
  margin: 0;
}

.grouped-followups .followup-customer-group > summary {
  background: #f7faff;
}

.followup-group-list {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

.followup-group-list .followup-item {
  border-radius: 6px;
}

.followup-group-list .followup-item summary {
  grid-template-columns: 110px 120px 80px minmax(160px, 1fr);
  padding: 7px 9px;
}

.followup-group-list .followup-detail {
  padding: 8px 9px;
}

.followup-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 760px) {
  .followup-item summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.account-group-stack {
  display: grid;
  gap: 14px;
}

.account-group-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.account-group-section h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.account-group-section .table-wrap {
  border: 0;
  border-radius: 0;
}

.department-account-stack {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.department-account-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.department-account-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  cursor: pointer;
  background: #eef5ff;
  color: var(--text);
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.department-account-fold summary span {
  color: var(--muted);
}

.department-account-fold summary:hover,
.department-account-fold summary:focus {
  color: var(--primary);
  background: #dcecff;
  box-shadow: inset 3px 0 0 var(--primary);
  outline: none;
}

.department-account-fold .table-wrap {
  border-top: 1px solid var(--line);
}

.account-subtitle {
  padding: 8px 12px 6px;
  font-weight: 700;
  color: var(--muted);
}

.assignment-picker-summary {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.assignment-picker-summary p {
  margin: 4px 0 0;
  color: var(--muted);
}

.participant-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.participant-toolbar input {
  min-width: 220px;
  flex: 1 1 240px;
  height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.participant-count {
  margin: 8px 0;
  color: var(--muted);
}

.participant-groups {
  display: grid;
  gap: 8px;
}

.participant-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.participant-group summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: #eef5ff;
}

.participant-group summary:hover,
.participant-group summary:focus {
  color: var(--primary);
  background: #dcecff;
  outline: none;
}

.participant-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px;
}

.participant-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.participant-row:hover,
.participant-row:focus-within {
  border-color: #8bbcff;
  background: #eaf4ff;
}

.participant-row span,
.participant-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

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

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

.span-three {
  grid-column: 1 / -1;
}

.span-full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.field input[readonly],
.field select[readonly],
.field textarea[readonly],
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: #667085;
  background: #eef2f7;
  border-color: #d7dee8;
  cursor: not-allowed;
  box-shadow: none;
}

.field select.has-selection:not(:disabled),
.field input[type="date"].has-selection:not(:disabled) {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
  font-weight: 700;
}

.field select.selection-tone-red:not(:disabled),
.field input[type="date"].selection-tone-red:not(:disabled) {
  color: #c62828;
  background: #fff1f0;
  border-color: #ff9f99;
}

.field select.selection-tone-orange:not(:disabled),
.field input[type="date"].selection-tone-orange:not(:disabled) {
  color: #b85c00;
  background: #fff7e6;
  border-color: #ffc069;
}

.field select.selection-tone-blue:not(:disabled),
.field input[type="date"].selection-tone-blue:not(:disabled) {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
}

.field select.selection-tone-gray:not(:disabled),
.field input[type="date"].selection-tone-gray:not(:disabled) {
  color: #475467;
  background: #f5f7fa;
  border-color: #cfd8e3;
}

.field.is-readonly label,
.field:has(input[readonly]) label,
.field:has(input:disabled) label,
.field:has(select:disabled) label,
.field:has(textarea:disabled) label {
  color: #8a95a6;
}

.field.missing input,
.field.missing select,
.field.missing textarea,
.field.missing .upload-add,
.field.missing .verify-box,
.field.missing .compact-notice,
.field.missing .empty-inline {
  border-color: #f04438;
  background: #fff5f4;
}

.field.missing label,
.field.missing .field-error {
  color: #d92d20;
}

.field-error {
  display: none;
  font-size: 10px;
  font-weight: 600;
}

.field.missing .field-error {
  display: block;
}

.inline-control {
  display: flex;
  gap: 8px;
}

.inline-control input {
  flex: 1;
  min-width: 0;
}

.inline-control .btn {
  flex: 0 0 auto;
}

.verify-box {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.verify-box.neutral {
  color: var(--muted);
  background: var(--panel-2);
}

.verify-box.ok {
  color: var(--green);
  background: var(--green-bg);
  border-color: #b7e2ca;
}

.verify-box.bad {
  color: var(--red);
  background: var(--red-bg);
  border-color: #f5b8b4;
}

.payment-records {
  display: grid;
  gap: 8px;
}

.order-items-field {
  padding: 8px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-items-table {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.order-items-head,
.order-item-row {
  display: grid;
  grid-template-columns: 46px 28px minmax(120px, 1.35fr) minmax(96px, 1fr) 96px 62px 70px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.order-items-head {
  min-height: 32px;
  padding: 0 6px;
  color: var(--muted);
  background: #f3f6fa;
  font-weight: 700;
}

.order-item-row {
  min-height: 42px;
  padding: 5px 6px;
  border-top: 1px solid var(--line);
}

.order-item-actions {
  display: flex;
  gap: 3px;
}

.mini-icon-btn {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #f4f8ff;
  border: 1px solid #c8dcfb;
  border-radius: 5px;
  font-weight: 700;
}

.order-item-row select,
.order-item-row input {
  min-width: 0;
  width: 100%;
  min-height: 28px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.qty-stepper {
  display: grid;
  grid-template-columns: 24px minmax(30px, 1fr) 24px;
  gap: 3px;
  align-items: center;
}

.qty-stepper button {
  min-height: 28px;
  background: #eef5ff;
  border: 1px solid #c8dcfb;
  border-radius: 5px;
  color: var(--primary);
  font-weight: 700;
}

.order-item-price,
.order-item-subtotal {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 860px) {
  .order-items-head,
  .order-item-row {
    grid-template-columns: 42px 24px minmax(110px, 1.25fr) minmax(92px, 1fr) 88px 58px;
  }

  .order-items-head span:nth-child(7),
  .order-item-subtotal {
    display: none;
  }
}

.order-items-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.product-variants {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.product-variant-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) 100px 58px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.product-variant-row input {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.customer-order-detail-table .table-wrap {
  max-width: 100%;
  overflow: auto;
  border-radius: 7px;
}

.customer-order-detail-table table {
  min-width: 1040px;
}

.customer-order-detail-table th,
.customer-order-detail-table td {
  vertical-align: top;
  white-space: nowrap;
}

.customer-order-detail-table td:nth-child(3) {
  min-width: 190px;
  white-space: normal;
}

.order-product-summary {
  display: grid;
  gap: 4px;
}

.order-product-line {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.order-product-line strong {
  color: var(--text);
  font-weight: 700;
}

.order-product-line span {
  color: var(--muted);
  font-size: 10px;
}

.payment-hover {
  position: relative;
  display: inline-flex;
}

.payment-hover-card {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 80;
  display: none;
  min-width: 360px;
  max-width: 520px;
  padding: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}

.payment-hover:hover .payment-hover-card {
  display: grid;
  gap: 6px;
}

.payment-hover-card.portal {
  display: grid;
  gap: 6px;
}

.payment-hover-head,
.payment-hover-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 0.8fr;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.payment-hover-row small {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-sort-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sort-header-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}

.table-sort-button.active {
  color: var(--blue);
}

.sort-menu-options {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  left: 0;
  display: none;
  min-width: 74px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #2c84d8;
  box-shadow: 0 6px 16px rgba(12, 31, 56, 0.16);
}

.sort-header-menu.open .sort-menu-options {
  display: grid;
}

.sort-menu-options button {
  border: 0;
  background: transparent;
  color: #1d3553;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.sort-menu-options button:hover,
.sort-menu-options button.active {
  background: #2f86de;
  color: #ffffff;
}

.floating-sort-menu {
  position: absolute;
  z-index: 3000;
  min-width: 86px;
  display: grid;
  gap: 2px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #2c84d8;
  border-radius: 5px;
  box-shadow: 0 10px 24px rgba(12, 31, 56, 0.18);
}

.floating-sort-menu button {
  min-height: 28px;
  padding: 5px 9px;
  color: #1d3553;
  background: transparent;
  border: 0;
  border-radius: 4px;
  text-align: left;
  white-space: nowrap;
}

.floating-sort-menu button:hover,
.floating-sort-menu button.active {
  color: #ffffff;
  background: #2f86de;
}

.order-detail-body {
  display: grid;
  gap: 12px;
}

.order-detail-lines {
  display: grid;
  gap: 8px;
}

.order-detail-lines p,
.order-shipping-card p {
  margin: 0;
}

.order-detail-section {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.order-detail-section h3 {
  margin: 0 0 8px;
  padding: 6px 8px;
  background: #f4f7fb;
  font-size: 13px;
}

.order-shipping-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.shipping-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.shipping-title span {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 700;
}

.shipping-title strong {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

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

.shipping-info-grid p {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.shipping-info-grid strong {
  flex: 0 0 auto;
}

.shipping-info-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.invoice-flow {
  display: grid;
  gap: 10px;
}

.readonly-box {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 5px 7px;
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.commission-tier-list {
  display: grid;
  gap: 8px;
}

.commission-tier-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.payment-record {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.payment-record span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.pay-method-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.enterprise-wechat-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 7px;
  color: #ffffff;
  background: linear-gradient(135deg, #1687ff, #18c37e);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(22, 135, 255, 0.18);
}

.enterprise-wechat-icon.muted-icon {
  color: #6b7a90;
  background: #eef3f9;
  box-shadow: none;
}

.optional-payment-query label::after {
  content: "（非企业微信可不填）";
  color: var(--muted);
  font-weight: 400;
}

.table-wrap .btn + .btn {
  margin-left: 5px;
}

.empty-inline {
  min-height: 34px;
  padding: 8px 9px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--line);
  border-radius: 7px;
}

.wechat-bind-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.qr-bind-card {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.qr-bind-card.error {
  color: #b42318;
  border-color: #fecaca;
  background: #fff5f5;
}

.qr-bind-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qr-bind-image {
  width: 150px;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.qr-bind-copy {
  display: grid;
  gap: 6px;
}

.qr-bind-copy p {
  margin: 0;
  color: var(--muted);
}

.rule-list {
  display: grid;
  gap: 10px;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}

.fake-qr {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 24px 24px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 24px 24px,
    #fff;
  border: 10px solid #fff;
  outline: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(21, 35, 54, 0.08);
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.12);
}

.inline-select {
  min-width: 50px;
  max-width: 65px;
  height: 29px;
  padding: 3px 18px 3px 5px;
  border: 1px solid #c8dcfb;
  border-radius: 8px;
  color: var(--primary);
  background: #f4f8ff;
  font-weight: 700;
}

.inline-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.12);
}

.inline-choice {
  position: relative;
  display: inline-flex;
}

.inline-choice-trigger {
  min-width: 38px;
  min-height: 24px;
  padding: 3px 7px;
  color: var(--primary);
  background: #f4f8ff;
  border: 1px solid #c8dcfb;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1.2;
}

.inline-choice-trigger:hover,
.inline-choice.open .inline-choice-trigger {
  background: #e7f0ff;
  border-color: var(--primary);
}

.inline-choice-trigger.has-selection {
  color: #0b63ce;
  background: #eef6ff;
  border-color: #8ab7f4;
}

.inline-choice-trigger.selection-tone-red {
  color: #c62828;
  background: #fff1f0;
  border-color: #ff9f99;
}

.inline-choice-trigger.selection-tone-orange {
  color: #b85c00;
  background: #fff7e6;
  border-color: #ffc069;
}

.inline-choice-trigger.selection-tone-blue {
  color: #0b63ce;
  background: #eef6ff;
  border-color: #8ab7f4;
}

.inline-choice-trigger.selection-tone-green {
  color: var(--green);
  background: var(--green-bg);
  border-color: #45c081;
}

.inline-choice-trigger.selection-tone-gray {
  color: #475467;
  background: #f5f7fa;
  border-color: #cfd8e3;
}

.inline-choice-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 72px;
  display: none;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 12px 26px rgba(21, 35, 54, 0.16);
}

.inline-choice.open .inline-choice-menu {
  display: grid;
  gap: 3px;
}

.inline-choice-menu button {
  min-height: 24px;
  padding: 4px 7px;
  color: var(--text);
  background: transparent;
  border-radius: 5px;
  text-align: left;
  white-space: nowrap;
}

.inline-choice-menu button:hover {
  color: var(--primary);
  background: var(--primary-2);
}

.floating-inline-choice {
  position: absolute;
  z-index: 1200;
  min-width: 118px;
  max-width: 220px;
  max-height: 286px;
  display: grid;
  gap: 3px;
  overflow: auto;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #1787d4;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.floating-inline-choice button {
  min-height: 28px;
  padding: 5px 8px;
  color: var(--text);
  background: transparent;
  border-radius: 5px;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.floating-inline-choice button:hover,
.floating-inline-choice button:focus {
  color: var(--primary);
  background: var(--primary-2);
}

.inline-popover {
  position: relative;
  display: inline-flex;
}

.inline-popover-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  display: none;
  background: #ffffff;
  border: 1px solid #1787d4;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.inline-popover.open .inline-popover-menu {
  display: block;
}

.service-wechat-menu {
  width: 138px;
  max-height: 232px;
  overflow: auto;
  border-color: #8ea3b6;
}

.service-wechat-menu button {
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  white-space: nowrap;
}

.service-wechat-menu button:hover,
.service-wechat-menu button:focus {
  color: #ffffff;
  background: #2f80d1;
}

.service-wechat-menu .inline-popover-clear {
  color: #ffffff;
  background: #9b9b92;
  text-align: center;
}

.floating-service-wechat-menu {
  position: absolute;
  z-index: 3000;
  display: block;
}

.inline-empty {
  display: block;
  padding: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.tag-display-button {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.tag-display-button:hover,
.tag-edit-popover.open .tag-display-button {
  background: #f4f8ff;
  border-color: #c8dcfb;
}

.tag-edit-menu {
  width: 164px;
  max-height: 286px;
  overflow: auto;
  padding: 7px;
  border-color: #8ea3b6;
}

.floating-tag-editor {
  position: absolute;
  z-index: 1200;
  background: #ffffff;
  border: 1px solid #1787d4;
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.tag-edit-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px;
  border-radius: 5px;
  cursor: pointer;
}

.tag-edit-option:hover {
  background: var(--primary-2);
}

.tag-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.muted-inline {
  color: var(--muted);
}

.location-menu {
  width: 448px;
  padding: 8px;
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inline-popover.open .location-menu {
  display: grid;
}

.floating-location-editor {
  position: absolute;
  z-index: 1200;
  width: 448px;
  max-width: calc(100vw - 16px);
  display: grid;
  background: #ffffff;
  border: 1px solid #1787d4;
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.location-menu select {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.location-menu .btn {
  min-height: 30px;
  border-radius: 4px;
}

.btn.dark {
  color: #ffffff;
  background: #263442;
}

.floating-follow,
.quick-follow-menu {
  width: 292px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #1787d4;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.floating-follow {
  position: absolute;
  z-index: 1200;
}

.floating-inline-editor {
  position: absolute;
  z-index: 1200;
  width: 300px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #1787d4;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.floating-phone-editor {
  position: absolute;
  z-index: 1200;
  width: 338px;
  max-width: calc(100vw - 20px);
  padding: 9px;
  background: #ffffff;
  border: 1px solid #1787d4;
  border-radius: 5px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.18);
}

.floating-phone-editor > label,
.phone-list-field > label {
  color: var(--primary);
  font-weight: 700;
}

.phone-editor-list {
  display: grid;
  gap: 7px;
}

.phone-editor-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  align-items: center;
}

.phone-editor-row input[type="radio"] {
  width: 16px;
  min-height: 16px;
}

.phone-editor-row input[name="phoneValue"] {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.phone-list-field {
  padding: 8px;
  background: #f8fbff;
  border: 1px dashed #c8dcfb;
  border-radius: 8px;
}

.phone-list-field.missing {
  border-color: #f04438;
  background: #fff5f4;
}

.detail-subview {
  margin-bottom: 12px;
}

.compact-head {
  min-height: 42px;
  padding: 8px 10px;
}

input[type="date"].empty-date::-webkit-datetime-edit {
  color: transparent;
}

input[type="date"].empty-date:focus::-webkit-datetime-edit {
  color: var(--text);
}

.floating-inline-editor label {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.floating-inline-editor input,
.floating-inline-editor textarea {
  width: 100%;
  min-height: 32px;
  padding: 7px 8px;
  color: var(--text);
  background: #f7ffff;
  border: 1px solid #20a7c7;
  border-radius: 4px;
  outline: none;
}

.floating-inline-editor textarea {
  min-height: 88px;
  resize: vertical;
}

.floating-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.quick-follow-menu {
  left: auto;
  right: 0;
}

.floating-follow label,
.quick-follow-menu label {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
}

.floating-follow input[type="datetime-local"],
.floating-follow textarea,
.quick-follow-menu textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 8px;
  background: #f1ffff;
  border: 1px solid #20a7c7;
  border-radius: 4px;
  outline: none;
}

.floating-follow input[type="datetime-local"] {
  min-height: 34px;
  margin-bottom: 8px;
  resize: none;
}

.inline-confirm-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-confirm-field input[type="datetime-local"] {
  margin-bottom: 0;
}

.inline-confirm-field .btn {
  white-space: nowrap;
  min-height: 34px;
}

.schedule-time-field .field-error {
  display: block;
  min-height: 16px;
  margin-top: 4px;
}

.quick-follow-upload {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 8px 0;
}

.quick-upload-plus,
.quick-upload-paste {
  width: 64px;
  height: 64px;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  color: var(--text) !important;
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 4px;
  text-align: center;
}

.quick-upload-plus span {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.quick-upload-plus input {
  display: none;
}

.quick-upload-paste {
  width: 72px;
}

.quick-upload-paste input {
  width: 100%;
  border: 0;
  outline: none;
  text-align: center;
}

.quick-follow-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.inline-tag-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 108px;
}

.inline-tag-option {
  display: inline-flex;
  cursor: pointer;
}

.inline-tag-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.inline-tag-option input:checked + .tag-icon {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 105, 210, 0.18);
  transform: translateY(-1px);
}

input[type="checkbox"]:not(.inline-tag-option input) {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--primary);
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

input[type="checkbox"]:not(.inline-tag-option input):hover {
  outline-color: rgba(23, 105, 210, 0.3);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.1);
}

input[type="checkbox"]:not(.inline-tag-option input):checked {
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.16);
}

tr:has(input[type="checkbox"]:checked) {
  background: #f3f8ff;
}

.check-line:has(input[type="checkbox"]:hover),
.check-line:hover {
  border-color: rgba(23, 105, 210, 0.45);
  background: #f4f8ff;
}

.check-line:has(input[type="checkbox"]:checked) {
  border-color: rgba(23, 105, 210, 0.65);
  background: #eaf3ff;
}

.mobile-card-main .inline-tag-picker {
  justify-content: flex-end;
  min-width: 92px;
  max-width: 46%;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-grid.compact .check-line {
  min-height: 30px;
  padding: 6px 9px;
}

.btn {
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 7px;
  background: #eef2f7;
  color: var(--text);
  border: 1px solid transparent;
  transition: transform 0.08s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  background: #e5ebf3;
}

.btn.clicked {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.97);
}

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

.btn.primary {
  color: #ffffff;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  box-shadow: 0 7px 14px rgba(23, 105, 210, 0.18);
}

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

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.phone-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-btn {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #c8dcfb;
  border-radius: 7px;
  background: #f4f8ff;
  color: var(--primary);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: #e7f0ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.1);
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid #b7e2ca;
  border-radius: 10px;
  background: #e6f6ee;
  color: #0b6b3a;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #f5b8b4;
  background: #fee4e2;
  color: #b42318;
}

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

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0 0;
  color: var(--muted);
}

.pagination-bar .btn {
  min-width: 64px;
}

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

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-size-control select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.customer-fit-table {
  overflow-x: hidden;
}

.customer-fit-table table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.customer-fit-table th,
.customer-fit-table td {
  box-sizing: border-box;
  padding: 5px 4px;
  max-width: none;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.customer-fit-table .customer-col-check { width: 24px; max-width: 24px; text-align: center; }
.customer-fit-table .customer-col-channel { width: 62px; max-width: 62px; }
.customer-fit-table .customer-col-name { width: 76px; max-width: 76px; }
.customer-fit-table .customer-col-phone { width: 112px; max-width: 112px; }
.customer-fit-table .customer-col-wechat { width: 88px; max-width: 88px; }
.customer-fit-table .customer-col-wxContact { width: 58px; max-width: 58px; }
.customer-fit-table .customer-col-phoneContact { width: 58px; max-width: 58px; }
.customer-fit-table .customer-col-shopStatus { width: 66px; max-width: 66px; }
.customer-fit-table .customer-col-createdAt { width: 76px; max-width: 76px; }
.customer-fit-table .customer-col-location { width: 86px; max-width: 86px; }
.customer-fit-table .customer-col-orderCount { width: 32px; max-width: 32px; }
.customer-fit-table .customer-col-latestFollowup { width: 86px; max-width: 86px; }
.customer-fit-table .customer-col-remark { width: 64px; max-width: 64px; }
.customer-fit-table .customer-col-appointment { width: 86px; max-width: 86px; }
.customer-fit-table .customer-col-serviceWechat { width: 68px; max-width: 68px; }
.customer-fit-table .customer-col-tags { width: 74px; max-width: 74px; }
.customer-fit-table .customer-col-owner { width: 56px; max-width: 56px; }
.customer-fit-table .customer-col-actions { width: 162px; max-width: 162px; overflow: visible; white-space: nowrap; }

.public-sea-table {
  overflow-x: auto;
}

.public-sea-table table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
}

.public-sea-table .customer-col-channel { width: 7%; max-width: none; }
.public-sea-table .customer-col-name { width: 7%; max-width: none; }
.public-sea-table .customer-col-phone { width: 10%; max-width: none; }
.public-sea-table .customer-col-wechat { width: 8%; max-width: none; }
.public-sea-table .customer-col-category { width: 9%; max-width: none; }
.public-sea-table .customer-col-formName { width: 11%; max-width: none; }
.public-sea-table .customer-col-createdAt { width: 8%; max-width: none; }
.public-sea-table .customer-col-holder { width: 8%; max-width: none; }
.public-sea-table .customer-col-remark { width: 12%; max-width: none; }
.public-sea-table .customer-col-status { width: 6%; max-width: none; }
.public-sea-table .customer-col-actions { width: 76px; max-width: 76px; }

.customer-fit-table .btn {
  min-height: 22px;
  margin: 0 2px 2px 0;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.2;
}

.customer-fit-table .btn:disabled,
.customer-fit-table .btn.disabled {
  color: #94a3b8;
  background: #edf2f7;
  border-color: #d7e0ea;
  box-shadow: none;
  cursor: not-allowed;
}

.customer-fit-table .inline-text-edit {
  max-width: 100%;
  min-height: 20px;
  font-size: 11px;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-fit-table .customer-cell-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-fit-table .customer-remark-clip {
  position: relative;
}

.customer-fit-table .customer-remark-clip:hover::after {
  content: attr(data-full-text);
  position: fixed;
  z-index: 3000;
  max-width: 360px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  transform: translate(8px, 18px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.customer-fit-table .tag-icon {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 17px;
}

.customer-fit-table .phone-cell {
  gap: 3px;
}

.customer-fit-table .icon-btn {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 10px;
}

.column-settings-btn {
  color: #0f56b3;
  background: #e8f2ff;
  border-color: #9cc8ff;
  box-shadow: 0 1px 2px rgba(24, 96, 184, 0.12);
}

.column-settings-btn:hover {
  color: #ffffff;
  background: #1769d1;
  border-color: #1769d1;
}

.choice-select {
  position: relative;
}

.choice-select-button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
}

.choice-select-button::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
}

.choice-select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-select.open .choice-select-button {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.12);
}

.choice-select.has-selection .choice-select-button {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
  font-weight: 700;
}

.choice-select.selection-tone-red .choice-select-button {
  color: #c62828;
  background: #fff1f0;
  border-color: #ff9f99;
}

.choice-select.selection-tone-orange .choice-select-button {
  color: #b85c00;
  background: #fff7e6;
  border-color: #ffc069;
}

.choice-select.selection-tone-blue .choice-select-button {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
}

.choice-select.selection-tone-gray .choice-select-button {
  color: #475467;
  background: #f5f7fa;
  border-color: #cfd8e3;
}

.choice-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 3000;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #8ea3b6;
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(21, 35, 54, 0.18);
}

.choice-select.open .choice-select-menu {
  display: grid;
  gap: 3px;
}

.choice-select-menu button {
  min-height: 30px;
  padding: 6px 8px;
  color: var(--text);
  background: transparent;
  border-radius: 5px;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.choice-select-menu button:hover,
.choice-select-menu button:focus {
  color: var(--primary);
  background: var(--primary-2);
}

.owner-tree-menu {
  min-width: 640px;
  width: min(720px, calc(100vw - 24px));
  max-height: none;
  overflow: visible;
  padding: 0;
}

.owner-tree-menu.owner-tree-compact {
  min-width: 560px;
  width: min(640px, calc(100vw - 24px));
  font-size: 11px;
}

.owner-tree-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  border-bottom: 1px solid #edf1f6;
}

.owner-tree-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.owner-tree-cascade {
  position: relative;
  display: grid;
  min-height: 188px;
  max-height: 260px;
  overflow: visible;
}

.owner-tree-column {
  width: 180px;
  min-width: 180px;
  max-height: none;
  overflow: visible;
  padding: 6px;
  background: #ffffff;
}

.owner-tree-menu.owner-tree-compact .owner-tree-column {
  width: 160px;
  min-width: 160px;
  font-size: 11px;
}

.owner-tree-column-0 {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  border-right: 1px solid #edf1f6;
}

.owner-tree-column-1,
.owner-tree-column-2,
.owner-tree-column-3,
.owner-tree-column-4 {
  position: absolute;
  top: 0;
  bottom: 0;
  display: none;
  align-content: start;
  gap: 2px;
  border-right: 1px solid #edf1f6;
  box-shadow: none;
}

.owner-tree-column-1 { left: 180px; }
.owner-tree-column-2 { left: 360px; }
.owner-tree-column-3 { left: 540px; }
.owner-tree-column-4 { left: 540px; }
.owner-tree-column-1 { z-index: 2; }
.owner-tree-column-2 { z-index: 3; }
.owner-tree-column-3 { z-index: 4; }
.owner-tree-column-4 { z-index: 5; }

.owner-tree-menu.owner-tree-compact .owner-tree-column-1 { left: 160px; }
.owner-tree-menu.owner-tree-compact .owner-tree-column-2 { left: 320px; }
.owner-tree-menu.owner-tree-compact .owner-tree-column-3 { left: 480px; }
.owner-tree-menu.owner-tree-compact .owner-tree-column-4 { left: 480px; }

.owner-tree-cascade-item:hover > .owner-tree-column,
.owner-tree-cascade-item:focus-within > .owner-tree-column {
  display: grid;
}

.owner-tree-parent {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  color: var(--text);
  background: transparent;
  border-radius: 5px;
  text-align: left;
}

.owner-tree-parent span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-tree-parent em {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
}

.owner-tree-parent b {
  color: var(--primary);
  font-weight: 700;
}

.owner-tree-parent:hover,
.owner-tree-parent:focus,
.owner-tree-cascade-item:hover > .owner-tree-parent,
.owner-tree-cascade-item:focus-within > .owner-tree-parent {
  color: var(--primary);
  background: #e8f2ff;
  outline: none;
}

.owner-tree-filter-hidden {
  display: none !important;
}

.owner-tree-branch,
.owner-tree-node {
  position: relative;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  background: #fff;
}

.owner-tree-branch + .owner-tree-branch,
.owner-tree-node + .owner-tree-node,
.owner-tree-option + .owner-tree-node,
.owner-tree-node + .owner-tree-option {
  margin-top: 4px;
}

.owner-tree-branch > summary,
.owner-tree-node > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 4px 7px;
  cursor: pointer;
  color: var(--text);
  background: #f7faff;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.owner-tree-branch > summary::before,
.owner-tree-node > summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.owner-tree-node > summary {
  padding: 3px 5px;
  background: #fbfdff;
}

.owner-tree-node > summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.owner-tree-branch > summary span,
.owner-tree-node > summary span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.owner-tree-branch > summary:hover,
.owner-tree-node > summary:hover,
.owner-tree-branch > summary:focus,
.owner-tree-node > summary:focus {
  color: var(--primary);
  font-weight: 700;
  background: #e5f0ff;
  border-color: #1769d2;
  box-shadow: 0 0 0 2px rgba(23, 105, 210, 0.14);
  outline: none;
}

.owner-tree-branch > summary:hover::before,
.owner-tree-node > summary:hover::before,
.owner-tree-branch > summary:focus::before,
.owner-tree-node > summary:focus::before {
  background: var(--primary);
}

.owner-tree-branch > summary:hover span,
.owner-tree-node > summary:hover span,
.owner-tree-branch > summary:focus span,
.owner-tree-node > summary:focus span {
  color: var(--primary);
}

.owner-tree-level {
  display: none;
  gap: 4px;
  padding: 5px;
  min-width: 226px;
  width: 226px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #8ea3b6;
  border-radius: 7px;
  box-shadow: 0 14px 30px rgba(21, 35, 54, 0.16);
  position: absolute;
  left: calc(100% + 6px);
  top: -1px;
  z-index: 90;
}

.owner-tree-menu.owner-tree-compact .owner-tree-level {
  min-width: 202px;
  width: 202px;
  font-size: 11px;
}

.owner-tree-menu.owner-tree-flip-left .owner-tree-level {
  left: auto;
  right: calc(100% + 6px);
}

.owner-tree-node .owner-tree-level {
  margin-left: 0;
  padding-left: 5px;
  border-left: 1px solid #8ea3b6;
}

.owner-tree-branch[open] > .owner-tree-level,
.owner-tree-node[open] > .owner-tree-level,
.owner-tree-branch:hover > .owner-tree-level,
.owner-tree-node:hover > .owner-tree-level {
  display: grid;
}

.owner-tree-option {
  width: 100%;
  min-height: 26px;
  padding: 4px 6px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-tree-option:hover,
.owner-tree-option:focus,
.owner-tree-option.active {
  color: var(--primary);
  background: var(--primary-2);
}

.owner-tree-empty {
  padding: 8px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .owner-tree-menu {
    width: min(92vw, 340px);
    max-height: 70vh;
    overflow: auto;
  }

  .owner-tree-level,
  .owner-tree-node .owner-tree-level {
    position: static;
    display: grid;
    min-width: 0;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: 0;
    border-left: 1px dashed var(--line);
    border-radius: 0;
    margin-left: 8px;
  }
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #f3f6fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: #f8fbff;
}

.customer-detail-row td,
.row-action-row td {
  padding: 0;
  background: #f7faff;
  white-space: normal;
}

.customer-detail-row:hover,
.row-action-row:hover {
  background: #f7faff;
}

.customer-detail-row .detail-panel,
.row-action-row .panel {
  margin: 8px;
  box-shadow: none;
}

.customer-tabs {
  border: 1px solid var(--line);
  background: #ffffff;
}

.customer-tab-head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #f3f6fa;
  border-bottom: 1px solid var(--line);
}

.customer-tab-head button {
  min-height: 48px;
  color: #667085;
  background: transparent;
  border-right: 1px solid var(--line);
  font-size: 14px;
}

.customer-tab-head button:last-child {
  border-right: 0;
}

.customer-tab-head button.active {
  color: var(--primary);
  background: #ffffff;
}

.customer-tab-pane {
  display: none;
  min-height: 260px;
  padding: 18px 22px;
}

.customer-tab-pane.active {
  display: block;
}

.green-title {
  margin: 22px 0 12px;
  color: var(--green);
  font-size: 14px;
}

.detail-panel .customer-tabs ~ .detail-grid,
.detail-panel .customer-tabs ~ .grid,
.detail-panel .customer-tabs ~ .item-card {
  display: none;
}

.text-clip {
  display: inline-block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-2);
  color: var(--primary);
  font-size: 10px;
}

.tag.green {
  color: var(--green);
  background: var(--green-bg);
}

.tag.amber {
  color: var(--amber);
  background: var(--amber-bg);
}

.tag.red {
  color: var(--red);
  background: var(--red-bg);
}

.tag.gray {
  color: #475467;
  background: #f2f4f7;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-right: 3px;
  border-radius: 4px;
  color: #1b4f8f;
  background: #e8f1ff;
  border: 1px solid #c8dcfb;
  font-size: 10px;
}

.tag-icon {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  background: #fff;
}

.tag-icon.blue { color: #1769d2; background: #e7f0ff; }
.tag-icon.green { color: #108548; background: #e6f6ee; }
.tag-icon.red { color: #d92d20; background: #fee4e2; }
.tag-icon.orange { color: #b54708; background: #fff3d8; }
.tag-icon.purple { color: #6941c6; background: #f0eaff; }
.tag-icon.gray { color: #475467; background: #f2f4f7; }

.color-chip {
  width: 12px;
  height: 12px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  vertical-align: -1px;
}

.color-chip.blue { background: #1769d2; }
.color-chip.green { background: #108548; }
.color-chip.red { background: #d92d20; }
.color-chip.orange { background: #f79009; }
.color-chip.purple { background: #7a5af8; }
.color-chip.gray { background: #667085; }

.order-filter {
  position: relative;
  z-index: 30;
  overflow: visible;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.order-filter:focus-within,
.order-filter:has(.choice-select.open),
.order-filter:has(.tag-filter.open) {
  z-index: 2500;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
}

.compact-date-range {
  min-width: 0;
}

.date-range-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
}

.date-range-pair input {
  width: 100%;
  min-width: 0;
  padding-left: 7px;
  padding-right: 5px;
}

.date-range-pair span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.date-range-confirm {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

[data-customer-detail-follow] {
  display: none !important;
}

.customer-detail-followup-form {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.customer-detail-followup-form textarea {
  min-height: 82px;
}

.tag-filter-field {
  position: relative;
  z-index: 40;
}

.tag-filter-field:has(.tag-filter.open) {
  z-index: 2500;
}

.tag-filter {
  position: relative;
}

.tag-filter-button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: left;
}

.tag-filter-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #667085;
  flex: 0 0 auto;
}

.tag-filter-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-filter.open .tag-filter-button {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.1);
}

.tag-filter.has-selection .tag-filter-button {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
  font-weight: 700;
}

.tag-filter.selection-tone-red .tag-filter-button {
  color: #c62828;
  background: #fff1f0;
  border-color: #ff9f99;
}

.tag-filter.selection-tone-orange .tag-filter-button {
  color: #b85c00;
  background: #fff7e6;
  border-color: #ffc069;
}

.tag-filter.selection-tone-blue .tag-filter-button {
  color: #0b63ce;
  background: #f2f7ff;
  border-color: #8ab7f4;
}

.tag-filter.selection-tone-gray .tag-filter-button {
  color: #475467;
  background: #f5f7fa;
  border-color: #cfd8e3;
}

.tag-filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 3000;
  width: min(190px, 72vw);
  max-height: 260px;
  display: none;
  overflow: auto;
  padding: 6px 0;
  background: #ffffff;
  border: 1px solid #b9c4d3;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.tag-filter.open .tag-filter-menu {
  display: block;
}

.tag-filter-option {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.tag-filter-option:hover {
  background: var(--primary-2);
}

.tag-filter-option input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.tag-filter-empty {
  padding: 8px 10px;
  color: var(--muted);
}

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

.filter-summary {
  color: var(--muted);
  margin-left: auto;
  padding: 5px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.empty {
  padding: 42px 30px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  color: #9aa8ba;
  background: #f0f4f8;
  border-radius: 999px;
  font-size: 16px;
}

.empty p {
  margin: 6px 0 0;
}

.mobile-shell {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background: #eef3f8;
}

.mobile-top {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.mobile-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-title-wrap {
  min-width: 0;
}

.mobile-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.mobile-account {
  max-width: 128px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--text);
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  overflow: hidden;
}

.mobile-account span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-account-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
}

.mobile-account:active {
  background: #e8eef6;
}

.mobile-content {
  padding: 14px;
  padding-bottom: 78px;
}

.mobile-tabs {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 4;
  width: min(492px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(21, 35, 54, 0.16);
}

.mobile-tab {
  min-height: 38px;
  padding: 8px 4px;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  text-align: center;
  font-size: 10px;
}

.mobile-tab.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  font-weight: 700;
}

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

.item-card {
  padding: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(21, 35, 54, 0.04);
}

.detail-panel {
  margin-top: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.detail-block {
  padding: 12px;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.detail-block span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.detail-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
}

.item-card h3 {
  margin: 0;
  font-size: 14px;
}

.item-card p {
  line-height: 1.55;
}

.panel .grid .item-card {
  min-height: 112px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mobile-summary {
  margin: 0 0 12px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
}

.mobile-card-action {
  width: 100%;
  margin-top: 10px;
}

.mobile-form-card {
  display: grid;
  gap: 10px;
}

.mobile-app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #f2f5f8;
}

.mobile-app-top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(21, 35, 54, 0.08);
}

.mobile-brand-row,
.mobile-card-main,
.mobile-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-brand-lockup img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mobile-brand-lockup strong,
.mobile-brand-lockup span {
  display: block;
}

.mobile-brand-lockup strong {
  font-size: 14px;
}

.mobile-brand-lockup span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-logout,
.mobile-list-head button,
.mobile-module-nav button,
.mobile-quick-grid button {
  border: 1px solid var(--line);
  background: #ffffff;
}

.mobile-logout {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.mobile-page-title {
  margin: 12px 0 10px;
}

.mobile-page-title h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.mobile-page-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.mobile-module-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.mobile-module-nav button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.mobile-module-nav button.active {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.mobile-app-content {
  padding: 14px 12px 88px;
}

.mobile-app-content.no-bottom-tabs {
  padding-bottom: 18px;
}

.mobile-bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 12;
  width: min(536px, calc(100% - 20px));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  transform: translateX(-50%);
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(21, 35, 54, 0.18);
}

.mobile-bottom-tabs button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 4px;
  color: var(--muted);
  background: transparent;
  border-radius: 11px;
}

.mobile-bottom-tabs button.active {
  color: #ffffff;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

.mobile-hero-card,
.mobile-data-card,
.mobile-block,
.mobile-form-surface,
.mobile-section .panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(21, 35, 54, 0.06);
}

.mobile-hero-card {
  padding: 17px;
  color: #ffffff;
  background: linear-gradient(135deg, #1769d2 0%, #108548 100%);
  border: 0;
}

.mobile-hero-card span,
.mobile-hero-card strong {
  display: block;
}

.mobile-hero-card span {
  opacity: 0.82;
  font-size: 10px;
}

.mobile-hero-card strong {
  margin-top: 6px;
  font-size: 18px;
}

.mobile-hero-card p {
  margin: 12px 0 0;
  opacity: 0.9;
  line-height: 1.6;
}

.mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.mobile-dashboard-range {
  margin-bottom: 10px;
  overflow-x: auto;
}

.mobile-dashboard-range .range-tabs {
  width: max-content;
  min-width: 100%;
}

.mobile-metrics div,
.mobile-quick-grid button {
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(21, 35, 54, 0.04);
}

.mobile-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.mobile-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.mobile-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-quick-grid button {
  min-height: 48px;
  color: var(--text);
  font-weight: 700;
}

.mobile-block {
  padding: 13px;
}

.mobile-block h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.mobile-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mobile-list-head strong {
  display: block;
  font-size: 14px;
}

.mobile-list-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-list-head button {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--primary);
  border-color: #c8dcfb;
  border-radius: 999px;
  font-weight: 700;
}

.mobile-search-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 10px;
  padding: 8px 0;
  background: #eef3f8;
}

.mobile-search-bar input {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.mobile-card-list {
  display: grid;
  gap: 8px;
}

.mobile-data-card {
  padding: 12px;
}

.mobile-card-main h3 {
  margin: 0;
  font-size: 14px;
}

.mobile-card-main p,
.mobile-address {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.mobile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.mobile-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.mobile-card-actions button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 4px;
  color: var(--text);
  background: #f3f6fa;
  border-radius: 9px;
  font-weight: 700;
}

.mobile-card-actions button.primary {
  color: #ffffff;
  background: var(--primary);
}

.mobile-card-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.mobile-flow-head {
  margin-bottom: 12px;
}

.mobile-flow-head strong,
.mobile-flow-head span {
  display: block;
}

.mobile-flow-head strong {
  font-size: 16px;
}

.mobile-flow-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-form-surface {
  padding: 13px;
}

.mobile-form-surface .panel-body,
.mobile-form-surface .inline-form {
  padding: 0;
}

.mobile-form-surface .grid,
.mobile-form-surface .grid.three,
.mobile-form-surface .grid.four,
.mobile-form-surface .detail-grid,
.mobile-form-surface .payment-record {
  grid-template-columns: 1fr;
}

.mobile-form-surface .actions,
.mobile-form-surface .filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mobile-form-surface .btn {
  width: 100%;
}

.mobile-form-surface .order-items-field {
  padding: 10px;
}

.mobile-form-surface .order-items-table {
  border: 0;
  background: transparent;
}

.mobile-form-surface .order-items-head {
  display: none;
}

.mobile-form-surface .order-items-body {
  display: grid;
  gap: 8px;
}

.mobile-form-surface .order-item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.mobile-form-surface .order-item-actions {
  flex: 0 0 56px;
}

.mobile-form-surface .order-item-index {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.mobile-form-surface .order-item-row select {
  flex: 1 1 100%;
  min-height: 36px;
}

.mobile-form-surface .qty-stepper {
  flex: 1 1 142px;
}

.mobile-form-surface .order-item-price,
.mobile-form-surface .order-item-subtotal {
  flex: 1 1 86px;
  align-self: center;
  text-align: right;
  font-weight: 700;
}

.mobile-form-surface .order-items-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.mobile-section-compact .panel {
  box-shadow: none;
}

.mobile-section-compact .filter-grid {
  grid-template-columns: 1fr;
}

.mobile-primary-action {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 10px;
  font-weight: 700;
}

.mobile-secondary-action {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  color: var(--primary);
  background: #eef5ff;
  border: 1px solid #c8dcfb;
  border-radius: 10px;
  font-weight: 700;
}

.mobile-primary-action:disabled,
.mobile-secondary-action:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.mobile-field-label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.mobile-textarea {
  width: 100%;
  min-height: 88px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  background: #ffffff;
}

.attendance-config-inline {
  margin-top: 16px;
}

.attendance-filter-grid .field select,
.attendance-filter-grid .field input,
.attendance-filter-grid .choice-select-button {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.attendance-filter-grid .field:hover select,
.attendance-filter-grid .field:hover input,
.attendance-filter-grid .owner-tree-field:hover .choice-select-button {
  border-color: #8fb8f4;
  background: #fbfdff;
  box-shadow: 0 0 0 2px rgba(23, 105, 210, 0.08);
}

.attendance-filter-grid .owner-tree-branch > summary:hover,
.attendance-filter-grid .owner-tree-node > summary:hover {
  color: var(--primary);
  background: #eaf3ff;
}

.attendance-filter-grid .owner-tree-option:hover,
.attendance-filter-grid .owner-tree-option:focus {
  color: #0b5fc7;
  background: #dfeeff;
}

.attendance-rule-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d8e5f5;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--text);
}

.attendance-rule-summary:hover,
.attendance-summary-card:hover {
  border-color: #9fc2f6;
  background: #f1f7ff;
  box-shadow: 0 8px 18px rgba(23, 105, 210, 0.08);
}

.attendance-rule-summary .meta-line {
  color: var(--muted);
  white-space: nowrap;
}

.attendance-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.attendance-summary-card {
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #d8e5f5;
  border-radius: 8px;
  background: #f8fbff;
  text-align: left;
  cursor: pointer;
}

.attendance-summary-card span,
.attendance-summary-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.attendance-summary-card strong {
  display: block;
  margin: 4px 0;
  font-size: 22px;
  color: var(--text);
}

.attendance-summary-card.good {
  border-color: #b7ebc6;
  background: #f2fff6;
}

.attendance-summary-card.warn {
  border-color: #ffdca8;
  background: #fff8ec;
}

.attendance-summary-card.bad {
  border-color: #f5b8b4;
  background: #fff4f3;
}

.attendance-summary-card.info {
  border-color: #b9d5ff;
  background: #f2f7ff;
}

.attendance-summary-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.14);
}

.attendance-visual-section {
  margin: 12px 0;
}

.attendance-department-stack {
  display: grid;
  gap: 10px;
}

.attendance-department {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.attendance-department > summary {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fbff;
  cursor: pointer;
}

.attendance-department > summary strong {
  font-size: 13px;
}

.attendance-department > summary span {
  color: var(--muted);
  white-space: nowrap;
}

.attendance-department > summary .good {
  color: var(--green);
}

.attendance-department > summary .warn {
  color: #a65f00;
}

.attendance-department > summary .bad {
  color: var(--red);
}

.attendance-employee-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.attendance-employee-card {
  border: 1px solid #d8e5f5;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.attendance-employee-card.good {
  border-color: #b7ebc6;
}

.attendance-employee-card.warn {
  border-color: #ffdca8;
}

.attendance-employee-card.bad {
  border-color: #f5b8b4;
}

.attendance-employee-card.empty {
  border-color: #d7dee8;
  background: #fbfcfe;
}

.attendance-employee-card > summary {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(8, minmax(54px, .55fr));
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
}

.attendance-employee-card > summary span {
  color: var(--muted);
  white-space: nowrap;
}

.attendance-employee-card > summary b {
  color: var(--text);
}

.attendance-person {
  display: grid;
  gap: 2px;
}

.attendance-person strong {
  color: var(--text);
  font-size: 13px;
}

.attendance-person small {
  color: var(--muted);
}

.attendance-detail-grid {
  display: grid;
  grid-template-columns: 92px 54px minmax(112px, 1fr) minmax(112px, 1fr) 58px 74px minmax(146px, 1.2fr) minmax(180px, 1.6fr);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.attendance-detail-grid > div {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-right: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
  background: #ffffff;
  overflow: hidden;
}

.attendance-detail-grid > div:nth-child(8n) {
  border-right: 0;
}

.attendance-detail-head {
  color: var(--muted);
  background: #f3f6fa !important;
  font-weight: 700;
}

.attendance-cell {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.attendance-cell strong {
  color: var(--text);
}

.attendance-cell.missing {
  color: var(--red);
  font-weight: 700;
}

.attendance-address-cell {
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attendance-raw-records {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.attendance-raw-records > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  color: var(--text);
  background: #f8fbff;
  cursor: pointer;
  font-weight: 700;
}

.attendance-raw-records > summary span {
  color: var(--muted);
  font-weight: 500;
}

.attendance-raw-records .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0;
}

.attendance-summary-table table {
  min-width: 760px;
}

.attendance-summary-table tbody tr:hover,
.attendance-visual-section + .table-wrap tbody tr:hover {
  background: #f3f8ff;
}

.attendance-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #bfd5f4;
  color: #155db3;
  background: #f3f8ff;
  font-weight: 700;
}

.attendance-type.clock-out {
  border-color: #c8dbff;
  color: #2452b8;
  background: #f4f6ff;
}

.attendance-type.field {
  border-color: #bde8c8;
  color: #17823b;
  background: #f3fff6;
}

.attendance-field-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  color: #155db3;
  background: #eaf3ff;
  font-weight: 700;
}

.mobile-attendance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.mobile-attendance-tile {
  padding: 12px;
  border: 1px solid #d8e5f5;
  border-radius: 14px;
  background: #ffffff;
}

.mobile-attendance-tile span,
.mobile-attendance-tile em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.mobile-attendance-tile strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
  color: var(--text);
}

.mobile-attendance-tile.green {
  border-color: #b7ebc6;
  background: #f2fff6;
}

.mobile-attendance-tile.amber,
.mobile-attendance-tile.pending {
  border-color: #ffdca8;
  background: #fff8ec;
}

.mobile-attendance-tile.red {
  border-color: #ffc7c7;
  background: #fff3f3;
}

.mobile-attendance-tile.info {
  border-color: #b9d5ff;
  background: #f2f7ff;
}

.mobile-attendance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .attendance-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .mobile-attendance-summary,
  .mobile-attendance-actions {
    grid-template-columns: 1fr;
  }
}

.upload-add {
  min-height: 88px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed #9bbcf0;
  border-radius: 10px;
  color: var(--primary);
  background: #f4f8ff;
  font-weight: 700;
  cursor: pointer;
}

.upload-add span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-size: 18px;
  line-height: 1;
}

.upload-add input {
  display: none;
}

.upload-drop-target.dragging,
.upload-add.dragging,
.quick-upload-plus.dragging {
  border-color: var(--primary);
  background: #e8f2ff;
  box-shadow: 0 0 0 3px rgba(24, 96, 184, 0.12);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.upload-preview-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.upload-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.upload-preview span {
  max-width: 160px;
  padding: 5px 7px;
  color: var(--muted);
  background: #f4f7fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-remove {
  min-height: 24px;
  padding: 2px 6px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd0cc;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
}

.compact-notice {
  min-height: 38px;
  padding: 9px 10px;
  margin: 0;
}

.mobile-inline-order {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mobile-inline-order-head {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

.mobile-inline-order .panel-body,
.mobile-inline-order .inline-form {
  padding: 0;
}

.mobile-inline-order .field.span-three {
  grid-column: auto;
}

.mobile-empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 13px;
}

.mobile-form-surface {
  padding: 0;
  overflow: hidden;
}

.mobile-form-surface .panel-body,
.mobile-form-surface .inline-form {
  padding: 14px;
}

.mobile-section {
  display: grid;
  gap: 12px;
}

.meta-line {
  margin: 5px 0;
  color: var(--muted);
}

.file-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  color: var(--primary);
  background: var(--primary-2);
  border: 1px solid #c8dcfb;
  border-radius: 7px;
  font-weight: 600;
}

.file-link:hover {
  background: #dceaff;
}

.button-link {
  min-height: auto;
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-weight: 700;
  text-decoration: underline;
}

.button-link:hover {
  background: transparent;
  color: var(--primary-dark);
}

.inline-text-edit {
  max-width: 150px;
  min-height: 22px;
  padding: 0;
  overflow: hidden;
  color: var(--primary);
  background: transparent;
  border: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
}

.inline-text-edit:hover {
  color: var(--primary-dark);
}

.drawer-layer {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  left: 224px;
  z-index: 3200;
  pointer-events: none;
}

.drawer-layer.active {
  pointer-events: auto;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
}

.app-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, calc(100vw - 266px));
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: -22px 0 56px rgba(15, 23, 42, 0.2);
}

.drawer-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head strong {
  font-size: 14px;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #f8fafc;
}

.drawer-body .panel {
  margin: 0;
  box-shadow: none;
}

.drawer-body .panel + .panel,
.drawer-body .item-card + .item-card {
  margin-top: 12px;
}

.drawer-preview-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.drawer-preview-frame {
  width: 100%;
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upload-add.dragging {
  color: var(--primary);
  background: var(--primary-2);
  border-color: var(--primary);
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.upload-preview img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.timeline-item {
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.timeline-time {
  color: var(--muted);
  font-size: 10px;
}

.notice {
  padding: 11px 12px;
  margin-bottom: 14px;
  background: #fff8e8;
  border: 1px solid #f5d28b;
  border-radius: 10px;
  color: #6d4200;
}

.batch-progress {
  padding: 12px;
  margin: 12px 0 14px;
  background: #eef6ff;
  border: 1px solid #bad7ff;
  border-radius: 10px;
}

.batch-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--primary);
}

.batch-progress-head span {
  font-weight: 700;
}

.batch-progress-bar {
  height: 9px;
  margin: 10px 0 8px;
  overflow: hidden;
  background: #dfeaf8;
  border-radius: 999px;
}

.batch-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1769d2, #35a2ff);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.batch-progress p {
  margin: 0;
  color: var(--muted);
}

.company-announcement {
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #eef6ff;
  border: 1px solid #bad7ff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: var(--text);
}

.company-announcement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.company-announcement-head strong {
  color: var(--primary-dark);
}

.company-announcement-head span {
  color: var(--muted);
  font-size: 10px;
}

.company-announcement p {
  margin: 0;
  line-height: 1.6;
}

.announcement-textarea {
  min-height: 96px;
}

.welcome-panel {
  padding: 20px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}

.welcome-panel h2 {
  margin: 4px 0 6px;
  font-size: 14px;
  letter-spacing: 0;
}

.welcome-panel p {
  margin: 0;
  color: var(--muted);
}

.welcome-kicker {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary) !important;
}

.subnav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.subnav-button {
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.subnav-button.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.inner-panel {
  border-style: dashed;
  box-shadow: none;
}

.column-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .desktop-only {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    height: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100vw;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #17202c;
    box-shadow: 0 8px 22px rgba(21, 35, 54, 0.16);
    -webkit-overflow-scrolling: touch;
  }

  .brand {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 10px 0 0;
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 14px;
    white-space: nowrap;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 8px 11px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .shipping-info-grid {
    grid-template-columns: 1fr;
  }

  .main,
  .content,
  .panel,
  .item-card,
  .notice,
  .welcome-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .stats,
  .dashboard-grid,
  .quick-actions,
  .detail-grid,
  .grid,
  .grid.three,
  .filter-grid,
  .column-checks {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  table {
    width: max-content;
    min-width: 100%;
  }

  .payment-record {
    grid-template-columns: 1fr;
  }

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

  .actions {
    flex-direction: column;
  }

  .toast-host {
    top: auto;
    right: 10px;
    bottom: 86px;
    left: 10px;
  }

  .toast {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .drawer-layer {
    inset: 0;
    z-index: 3200;
  }

  .app-drawer {
    width: 100vw;
    height: 100dvh;
  }

  .drawer-body {
    padding: 12px;
    padding-bottom: 78px;
  }

  .drawer-head .btn {
    width: auto;
  }

  .inline-text-edit {
    max-width: 100%;
  }
}
