:root {
  --app-bg: #f5f7fb;
  --app-panel: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-line: #d9e1ea;
  --app-line-strong: #c6d2df;
  --app-text: #18212f;
  --app-muted: #647386;
  --app-primary: #167367;
  --app-primary-dark: #0f5149;
  --app-sidebar: #16202a;
  --app-blue: #2563eb;
  --app-success: #178057;
  --app-warning: #b7791f;
  --app-danger: #c2413a;
  --app-radius: 8px;
  --app-shadow-sm: 0 8px 18px rgba(24, 33, 47, 0.06);
  --app-shadow-md: 0 16px 34px rgba(24, 33, 47, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
  overscroll-behavior-y: contain;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border: 2px solid var(--app-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--app-primary-dark);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: var(--app-shadow-md);
  transition: transform 0.16s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 0;
}

.app-main:focus {
  outline: none;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.12);
}

.login-card h1 {
  margin: 18px 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.login-card p,
.login-card small {
  color: var(--app-muted);
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: var(--app-sidebar);
  color: #fff;
}

.brand-block,
.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  border-radius: 8px;
}

.brand-block {
  margin-bottom: 20px;
  color: #fff;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f5ef;
  color: var(--app-primary);
  font-size: 22px;
  font-weight: 800;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block small {
  color: rgba(255, 255, 255, 0.62);
}

.app-sidebar .nav-link {
  min-height: 44px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-note {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  padding: 14px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.sidebar-note i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #81d5a7;
  background: rgba(25, 135, 84, 0.18);
}

.sidebar-note span {
  color: rgba(255, 255, 255, 0.65);
}

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

.main-header,
.panel-title,
.header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.main-header {
  margin-bottom: 22px;
}

.main-header h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.admin-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  color: var(--app-muted);
}

.btn {
  border-radius: 8px;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: #15534e;
  --bs-btn-hover-border-color: #15534e;
}

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

.metric-card,
.panel-card {
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
}

.metric-card {
  min-height: 128px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric-card span,
.metric-card small,
.panel-title small,
.data-table small,
.statement-row small {
  color: var(--app-muted);
}

.metric-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 24px;
  letter-spacing: 0;
}

.metric-link {
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-link:hover {
  color: inherit;
  border-color: var(--app-primary);
  box-shadow: 0 20px 48px rgba(23, 33, 43, 0.12);
  transform: translateY(-1px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

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

.panel-card {
  padding: 18px;
  min-width: 0;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title h2,
.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.data-table {
  min-width: 920px;
  margin: 0;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.filter-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.filter-field span {
  color: var(--app-muted);
  font-size: 12px;
}

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

.filter-actions {
  display: flex;
  gap: 8px;
}

.table-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--app-muted);
}

.table-empty i {
  font-size: 28px;
}

.data-table th {
  color: var(--app-muted);
  font-size: 12px;
  white-space: nowrap;
  background: #f7f9fb;
}

.data-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--badge-color);
  background: color-mix(in srgb, var(--badge-color) 13%, white);
  font-size: 12px;
  font-weight: 700;
}

.stack {
  display: grid;
  gap: 12px;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.action-list .alert-row {
  align-items: center;
}

.action-list .alert-row > div {
  min-width: 0;
  flex: 1;
}

.action-list .alert-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.form-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-divider {
  padding-top: 4px;
  border-top: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.section-divider span {
  display: inline-flex;
  padding-top: 8px;
}

.wecom-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.wecom-mode-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.wecom-mode-tabs a.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
  color: #1d4ed8;
}

.wecom-mode-tabs em {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--app-muted);
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.alert-row,
.budget-line,
.timeline-item,
.option-row,
.statement-row {
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.alert-row {
  display: flex;
  gap: 12px;
  padding: 13px;
}

.alert-row i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
}

.alert-row span {
  display: block;
  color: var(--app-muted);
}

.alert-row.warning i {
  color: #d97706;
}

.alert-row.danger i {
  color: #dc3545;
}

.alert-row.info i {
  color: #0d6efd;
}

.budget-line {
  padding: 14px;
}

.budget-line div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e6edf3;
}

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

.quick-order-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 188px;
}

.quick-order-form .form-select {
  width: 104px;
  min-width: 104px;
}

.relation-link,
.subtle-link {
  color: var(--app-primary);
  font-weight: 700;
  text-decoration: none;
}

.subtle-link {
  color: var(--app-muted);
  font-weight: 600;
}

.relation-link:hover,
.subtle-link:hover {
  color: var(--app-primary);
  text-decoration: underline;
}

.statement-list,
.timeline-list,
.settings-grid {
  display: grid;
  gap: 12px;
}

.statement-row {
  display: grid;
  grid-template-columns: 1fr 180px 1.4fr;
  gap: 16px;
  padding: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.timeline-item > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf1ff;
  color: #0d6efd;
}

.timeline-item h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
}

.timeline-item p,
.timeline-item small {
  margin: 0;
  color: var(--app-muted);
}

.timeline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.approval-card-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.approval-card-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.approval-card-heading h3 {
  min-width: 0;
}

.approval-card-heading strong {
  flex: 0 0 auto;
  color: var(--app-primary);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.approval-card-meta,
.approval-card-linkage,
.approval-card-note {
  min-width: 0;
}

.approval-card-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.approval-card-actions {
  flex-wrap: wrap;
}

.employee-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.employee-card small,
.employee-card span {
  display: block;
  color: var(--app-muted);
}

.wecom-staff-card {
  grid-template-columns: 1fr;
  align-items: start;
}

.wecom-staff-card .actions-cell {
  justify-content: flex-start;
}

.wecom-staff-card > div {
  min-width: 0;
}

.score-pill {
  min-width: 42px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f5ef;
  color: var(--app-primary);
  font-size: 16px;
  font-weight: 800;
}

.score-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.score-card strong,
.score-card small,
.score-card p {
  display: block;
}

.score-card strong {
  word-break: keep-all;
}

.score-card small,
.score-card p {
  color: var(--app-muted);
}

.score-card p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.5;
}

body.admin-shell .employee-detail-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

body.admin-shell .employee-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

body.admin-shell .employee-detail-head h2 {
  margin: 2px 0 0;
  color: var(--app-text);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

body.admin-shell .employee-detail-head small,
body.admin-shell .employee-detail-head span {
  display: block;
  color: var(--app-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

body.admin-shell .employee-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body.admin-shell .employee-detail-score {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e2e8f0;
}

body.admin-shell .employee-detail-score article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #ffffff;
}

body.admin-shell .employee-detail-score span,
body.admin-shell .employee-detail-score small {
  color: var(--app-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

body.admin-shell .employee-detail-score strong {
  color: var(--app-text);
  font-size: 19px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .employee-detail-grid,
body.admin-shell .employee-detail-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.admin-shell .employee-detail-grid section,
body.admin-shell .employee-detail-lists section {
  min-width: 0;
}

body.admin-shell .employee-detail-grid h3,
body.admin-shell .employee-detail-lists h3 {
  margin: 0 0 9px;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
}

body.admin-shell .employee-detail-grid dl {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e2e8f0;
}

body.admin-shell .employee-detail-grid dl > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

body.admin-shell .employee-detail-grid dt,
body.admin-shell .employee-detail-grid dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

body.admin-shell .employee-detail-grid dt {
  color: var(--app-muted);
  font-weight: 850;
}

body.admin-shell .employee-detail-grid dd {
  color: var(--app-text);
  font-weight: 750;
}

body.admin-shell .employee-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-shell .employee-detail-lists article {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

body.admin-shell .employee-detail-lists article + article {
  margin-top: 8px;
}

body.admin-shell .employee-detail-lists article strong,
body.admin-shell .employee-detail-lists article span {
  overflow-wrap: anywhere;
}

body.admin-shell .employee-detail-lists article strong {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 900;
}

body.admin-shell .employee-detail-lists article span {
  color: var(--app-muted);
  font-size: 12px;
}

.payroll-preview {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #eef8f4;
  color: var(--app-primary);
  font-weight: 700;
}

.payroll-preview small {
  color: var(--app-muted);
  font-weight: 600;
}

.rule-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.rule-card strong,
.rule-card small {
  display: block;
}

.rule-card small {
  color: var(--app-muted);
}

.rule-tier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rule-tier-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.tier-edit-table {
  min-width: 680px;
}

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

.tier-edit-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #fbfdff;
}

.tier-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5edf5;
}

.tier-card-heading strong,
.tier-card-heading small {
  display: block;
}

.tier-card-heading strong {
  color: var(--app-text);
  font-size: 14px;
  font-weight: 850;
}

.tier-card-heading small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

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

.tier-card-fields .form-label {
  margin: 0;
}

.avatar-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.avatar-img,
.avatar-fallback {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.avatar-img {
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: #e7f5ef;
  color: var(--app-primary);
  font-weight: 800;
}

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

.settings-group {
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-group h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}

.role-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.role-title-row h3 {
  margin: 0;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f5ef;
  color: var(--app-primary);
  font-size: 12px;
  font-weight: 700;
}

.permission-tags.compact {
  gap: 4px;
  margin-bottom: 4px;
}

.permission-tags.compact span {
  padding: 3px 6px;
  font-size: 11px;
}

.role-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.role-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--app-line);
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.role-side-summary {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px;
  border-top: 1px solid #cde3dc;
  border-radius: 0 0 8px 8px;
  background: #f2faf7;
  color: var(--app-muted);
  font-size: 12px;
}

.role-side-details {
  margin: 10px 0 12px;
  border: 1px solid #cde3dc;
  border-radius: 8px;
  background: #f2faf7;
  overflow: hidden;
}

.role-side-details > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: var(--app-primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.role-side-details > summary::-webkit-details-marker {
  display: none;
}

.role-side-details > summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.role-side-details > summary em {
  min-width: 0;
  overflow: hidden;
  color: var(--app-muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-side-details > summary em::after {
  content: " ↓";
}

.role-side-details[open] > summary em::after {
  content: " ↑";
}

.role-side-summary span {
  color: var(--app-text);
  font-weight: 700;
}

.role-side-summary small {
  color: var(--app-muted);
}

.role-side-summary em {
  display: block;
  font-style: normal;
  color: var(--app-warning);
}

.role-permission-details {
  margin-top: 10px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
}

.role-permission-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.role-permission-details > summary::-webkit-details-marker {
  display: none;
}

.role-permission-details > summary em {
  color: var(--app-muted);
  font-style: normal;
  font-weight: 800;
}

.role-permission-details > summary em::after {
  content: " ↓";
}

.role-permission-details[open] > summary {
  border-bottom: 1px solid var(--app-line);
}

.role-permission-details[open] > summary em::after {
  content: " ↑";
}

.role-permission-details .permission-tags {
  padding: 10px;
}

.role-template-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.role-template-panel small {
  grid-column: 1 / -1;
  color: var(--app-muted);
}

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

.permission-adjustment-block {
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.permission-adjustment-block summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--app-text);
  font-weight: 700;
  list-style-position: inside;
}

.permission-adjustment-block summary small {
  margin-left: 8px;
  color: var(--app-muted);
  font-weight: 500;
}

.permission-adjustment-block .permission-category-grid {
  padding: 0 12px 12px;
  grid-template-columns: 1fr;
}

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

.permission-group {
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.permission-group strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.permission-group small {
  display: block;
  margin: -2px 0 10px;
  color: var(--app-muted);
  line-height: 1.5;
}

.permission-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.permission-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--app-muted);
  font-size: 13px;
}

.option-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
}

.option-row small {
  display: block;
  color: var(--app-muted);
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--app-primary);
  background: #e7f5ef;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

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

.attachment-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.attachment-preview {
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #fff;
  color: #dc3545;
  font-size: 34px;
}

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

.attachment-card strong,
.attachment-card small {
  display: block;
}

.attachment-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.attachment-heading {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.attachment-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-heading span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f5ef;
  color: var(--app-primary);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.attachment-card small {
  color: var(--app-muted);
  line-height: 1.5;
}

.attachment-file-name {
  overflow-wrap: anywhere;
  color: var(--app-text) !important;
  font-weight: 750;
}

.attachment-note {
  display: -webkit-box !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.attachment-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--app-muted);
  border: 1px dashed var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
}

.empty-state i {
  font-size: 38px;
  color: var(--app-primary);
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

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

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

/* Figma V1 operational console theme */
a {
  color: var(--app-primary);
}

a:hover {
  color: var(--app-primary-dark);
}

.login-page {
  background: var(--app-bg);
}

.login-card {
  border-color: var(--app-line);
  box-shadow: var(--app-shadow-md);
}

.app-frame {
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.04);
}

.brand-block {
  min-height: 48px;
  margin-bottom: 8px;
  padding: 4px 2px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: #e8f4f1;
  color: var(--app-primary);
}

.brand-block strong {
  line-height: 1.2;
}

.app-sidebar .nav-link {
  min-height: 34px;
  margin-bottom: 2px;
  padding: 0 11px;
  font-size: 13px;
}

.app-sidebar .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
  background: #263341;
  color: #fff;
}

.app-sidebar .nav-link.active {
  box-shadow: inset 3px 0 0 #57c4a2;
}

.nav-section {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px;
}

.nav-section + .nav-section {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-section-title {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  font-weight: 800;
}

.nav-section-title i {
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.sidebar-note {
  position: static;
  margin-top: auto;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.app-main {
  padding: 26px 28px 36px;
}

.main-header {
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--app-line);
}

.main-header h1 {
  font-size: 28px;
  line-height: 1.18;
}

.header-actions {
  align-items: center;
}

.header-actions form {
  margin: 0;
}

.period-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.period-form .form-control {
  width: 150px;
  min-height: 36px;
}

.admin-chip {
  min-height: 36px;
  border-color: var(--app-line);
  box-shadow: var(--app-shadow-sm);
  font-size: 13px;
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark);
  --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: #8fc9bd;
  --bs-btn-hover-bg: #e8f4f1;
  --bs-btn-hover-border-color: #65b5a6;
  --bs-btn-hover-color: var(--app-primary-dark);
  --bs-btn-active-bg: #d8eee8;
  --bs-btn-active-border-color: #65b5a6;
  --bs-btn-active-color: var(--app-primary-dark);
}

.btn-outline-secondary {
  --bs-btn-color: #4d5b6c;
  --bs-btn-border-color: var(--app-line-strong);
  --bs-btn-hover-bg: var(--app-surface-muted);
  --bs-btn-hover-border-color: #aebccb;
  --bs-btn-hover-color: var(--app-text);
}

.btn-outline-danger {
  --bs-btn-color: var(--app-danger);
  --bs-btn-border-color: #efb6b2;
  --bs-btn-hover-bg: #fdecec;
  --bs-btn-hover-border-color: #e79a95;
  --bs-btn-hover-color: #9e2d28;
}

.alert {
  border-radius: var(--app-radius);
  border-color: #b9d9f4;
  background: #eef7ff;
  color: #23527a;
}

.metric-card,
.panel-card {
  border-color: var(--app-line);
  box-shadow: var(--app-shadow-sm);
}

.metric-card {
  min-height: 124px;
  padding: 16px;
}

.metric-card span {
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  margin: 10px 0 5px;
  font-size: 24px;
  line-height: 1.12;
}

.metric-card small {
  line-height: 1.45;
}

.panel-card {
  padding: 18px;
}

.panel-title {
  align-items: center;
  margin-bottom: 16px;
}

.panel-title small {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 700;
}

.panel-title h2,
.modal-title {
  line-height: 1.25;
}

.dashboard-grid {
  gap: 18px;
}

.filter-toolbar {
  gap: 12px;
  padding: 14px;
  border-color: var(--app-line);
  background: var(--app-surface-muted);
}

.filter-field span {
  font-weight: 700;
}

.filter-actions {
  align-self: end;
  flex-wrap: wrap;
}

.form-control,
.form-select {
  min-height: 38px;
  border-color: var(--app-line-strong);
  border-radius: 7px;
  color: var(--app-text);
  font-size: 13px;
}

.form-control:focus,
.form-select:focus {
  border-color: #68b9ab;
  box-shadow: 0 0 0 3px rgba(22, 115, 103, 0.12);
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

.table-responsive {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.data-table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f3f8f7;
  min-width: 940px;
}

.summary-table {
  min-width: 100%;
}

.summary-table th,
.summary-table td {
  white-space: normal;
}

.summary-table .text-end {
  white-space: nowrap;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-color: #edf1f5;
}

.data-table th {
  color: #586779;
  font-weight: 800;
  letter-spacing: 0;
  background: #f8fafc;
}

.data-table td {
  font-size: 13px;
}

.data-table td strong {
  font-weight: 800;
}

.actions-cell {
  gap: 6px;
}

.actions-cell form {
  margin: 0;
}

.status-badge,
.attachment-pill,
.permission-tags span {
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  background: color-mix(in srgb, var(--badge-color) 12%, white);
}

.relation-link {
  color: var(--app-primary);
  text-underline-offset: 3px;
}

.subtle-link {
  color: #526174;
  text-underline-offset: 3px;
}

.alert-row,
.budget-line,
.timeline-item,
.option-row,
.statement-row,
.employee-card,
.score-card,
.settings-group,
.permission-group,
.attachment-card {
  border-color: var(--app-line);
  background: var(--app-surface-muted);
}

.alert-row,
.timeline-item,
.employee-card,
.score-card,
.settings-group,
.attachment-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.alert-row:hover,
.timeline-item:hover,
.employee-card:hover,
.score-card:hover,
.settings-group:hover,
.attachment-card:hover {
  border-color: #bed5cf;
  box-shadow: 0 8px 20px rgba(24, 33, 47, 0.05);
}

.alert-row i,
.timeline-item > i {
  box-shadow: inset 0 0 0 1px rgba(24, 33, 47, 0.04);
}

.alert-row.info i,
.timeline-item > i {
  background: #eaf1ff;
  color: var(--app-blue);
}

.alert-row.warning i {
  background: #fff7e6;
  color: var(--app-warning);
}

.alert-row.danger i {
  background: #fdecec;
  color: var(--app-danger);
}

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

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

.deployment-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: var(--app-surface-muted);
}

.deployment-check-row strong,
.deployment-check-row small {
  display: block;
}

.deployment-check-row code {
  max-width: 280px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f3f6f8;
  color: #344054;
  white-space: normal;
  overflow-wrap: anywhere;
}

.statement-row {
  background: #fff;
}

.progress {
  overflow: hidden;
  background: #e9eff5;
}

.progress-bar {
  background-color: var(--app-primary);
}

.employee-card,
.score-card {
  background: #fff;
}

.score-pill,
.avatar-fallback,
.attachment-pill,
.permission-tags span {
  background: #e8f4f1;
  color: var(--app-primary);
}

.payroll-preview {
  background: #e8f4f1;
  border-color: #b7ddd5;
  color: var(--app-primary-dark);
}

.avatar-img,
.avatar-fallback {
  border-radius: 8px;
}

.settings-grid {
  gap: 14px;
}

.settings-group {
  padding: 16px;
}

.settings-group > small,
.role-stats span {
  color: var(--app-muted);
}

.role-stats span {
  background: #fff;
  border-color: var(--app-line);
}

.permission-grid {
  gap: 12px;
}

.permission-category {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-muted);
}

.permission-category-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.permission-category-title strong {
  color: var(--app-text);
  font-size: 14px;
}

.permission-category-title small {
  color: var(--app-muted);
  font-size: 12px;
}

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

.permission-group {
  background: #fff;
}

.permission-group label {
  color: #536274;
  font-weight: 600;
}

.permission-table-group td {
  padding: 12px 14px;
  background: #eef7f4;
  color: var(--app-primary-dark);
  border-color: #cfe5df;
}

.permission-table-group strong,
.permission-table-group span {
  display: inline-flex;
  align-items: center;
}

.permission-table-group strong {
  margin-right: 12px;
  font-size: 14px;
}

.permission-table-group span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

.option-row {
  min-height: 62px;
  border-radius: var(--app-radius);
  background: #fff;
}

.option-category-list {
  display: grid;
  gap: 18px;
}

.option-category {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface-muted);
}

.option-category-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.option-category-title::-webkit-details-marker {
  display: none;
}

.option-category-title > i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--app-radius);
  background: #e8f4f1;
  color: var(--app-primary);
}

.option-category-title > div {
  min-width: 0;
  flex: 1 1 auto;
}

.option-category-title strong,
.option-category-title small {
  display: block;
}

.option-category-title strong {
  color: var(--app-text);
  font-size: 16px;
}

.option-category-title small {
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 12px;
}

.option-category-title em {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.option-category-title em::after {
  content: " ↓";
}

.option-category[open] .option-category-title em::after {
  content: " ↑";
}

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

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

.attachment-card {
  grid-template-columns: 92px minmax(0, 1fr);
  background: #fff;
}

.attachment-preview {
  background: var(--app-surface-muted);
}

.attachment-actions {
  align-items: center;
}

.empty-state {
  background: var(--app-surface-muted);
}

.form-grid {
  gap: 16px;
}

.form-label {
  display: grid;
  gap: 7px;
  width: 100%;
  margin: 0;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
}

.form-label:has(.form-check-input),
.form-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--app-text);
  font-size: 13px;
  font-weight: 700;
}

.form-text {
  color: var(--app-muted);
  font-size: 12px;
}

.modal-backdrop {
  --bs-backdrop-bg: #0d1722;
  --bs-backdrop-opacity: 0.42;
}

.modal-dialog {
  --bs-modal-margin: 18px;
}

.modal-content {
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-panel);
  box-shadow: 0 22px 60px rgba(24, 33, 47, 0.2);
}

.modal-header,
.modal-footer {
  padding: 15px 18px;
  background: var(--app-surface-muted);
}

.modal-header {
  border-bottom-color: var(--app-line);
}

.modal-footer {
  border-top-color: var(--app-line);
}

.modal-body {
  padding: 18px;
  background: var(--app-panel);
  overflow-y: auto;
}

.modal-body:not(.form-grid) > .form-label + .form-label,
.modal-body:not(.form-grid) > .form-check + .form-label,
.modal-body:not(.form-grid) > .form-label + .form-check {
  margin-top: 14px;
}

.btn-close:focus {
  box-shadow: 0 0 0 3px rgba(22, 115, 103, 0.12);
}

@media (min-width: 992px) {
  .modal-xl {
    --bs-modal-width: min(1120px, calc(100vw - 72px));
  }

  .modal-lg {
    --bs-modal-width: min(820px, calc(100vw - 72px));
  }
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .brand-block span:last-child,
  .app-sidebar .nav-link span,
  .nav-section-title span,
  .sidebar-note {
    display: none;
  }

  .app-sidebar .nav-link,
  .nav-section-title {
    justify-content: center;
  }

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

@media (max-width: 860px) {
  .app-frame {
    display: block;
  }

  .app-sidebar {
    position: static;
    height: auto;
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand-block {
    width: 100%;
    margin-bottom: 4px;
  }

  .brand-block span:last-child,
  .app-sidebar .nav-link span,
  .nav-section-title span {
    display: block;
  }

  .nav-section {
    width: 100%;
  }

  .nav-section-title {
    justify-content: flex-start;
    padding-left: 8px;
  }

  .app-sidebar .nav-link {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .app-main {
    padding: 16px;
  }

  .main-header,
  .panel-title,
  .header-actions,
  .filter-toolbar,
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .header-actions .btn {
    width: 100%;
  }

  .period-form,
  .period-form .form-control {
    width: 100%;
  }

  .kpi-grid,
  .settings-grid,
  .attachment-grid,
  .permission-grid,
  .permission-category-grid,
  .option-category-grid,
  .deployment-grid,
  .user-permission-adjustments,
  .role-template-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .form-grid .span-2 {
    grid-column: auto;
  }

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

  .timeline-actions {
    justify-content: flex-start;
  }

  body.admin-shell.page-approval .approval-card {
    gap: 10px;
  }

  body.admin-shell.page-approval .approval-card > i {
    display: none;
  }

  body.admin-shell.page-approval .approval-card-heading {
    display: grid;
    gap: 4px;
  }

  body.admin-shell.page-approval .approval-card-heading strong {
    justify-self: start;
  }

  body.admin-shell.page-approval .approval-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.admin-shell.page-approval .approval-card-actions .btn,
  body.admin-shell.page-approval .approval-card-actions form {
    width: 100%;
  }

  .search-field {
    grid-column: auto;
  }

  .employee-card {
    grid-template-columns: 1fr;
  }

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

  .deployment-check-row code {
    max-width: none;
  }
}

@media (max-width: 560px) {
  body.wecom-sidebar-entry {
    background: #eef3f7;
  }

  .wecom-sidebar-entry .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
  }

  .wecom-sidebar-entry .brand-block,
  .wecom-sidebar-entry .nav-section-title,
  .wecom-sidebar-entry .sidebar-note {
    display: none;
  }

  .wecom-sidebar-entry .nav-section {
    width: auto;
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
  }

  .wecom-sidebar-entry .app-sidebar .nav-link {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
  }

  .wecom-sidebar-entry .app-main {
    padding: 12px;
  }

  .wecom-sidebar-entry .main-header h1 {
    font-size: 20px;
  }

  .wecom-sidebar-entry .admin-chip,
  .wecom-sidebar-entry .period-form,
  .wecom-sidebar-entry .period-form .form-control {
    width: 100%;
  }

  .wecom-sidebar-entry .metric-card {
    min-height: 104px;
    padding: 12px;
  }

  .wecom-sidebar-entry .metric-card strong {
    font-size: 20px;
  }

  .wecom-sidebar-entry .panel-card {
    padding: 14px;
  }

  .wecom-sidebar-entry .panel-title h2 {
    font-size: 18px;
  }

  .wecom-sidebar-entry .filter-toolbar {
    gap: 8px;
  }
}

/* 2026 admin UI refresh: data-dense enterprise console */
:root {
  --app-bg: #f4f6f8;
  --app-panel: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-line: #d8e0e8;
  --app-line-strong: #b8c5d1;
  --app-text: #0f172a;
  --app-muted: #5b6777;
  --app-primary: #0f766e;
  --app-primary-dark: #115e59;
  --app-sidebar: #0f172a;
  --app-blue: #1e3a8a;
  --app-success: #15803d;
  --app-warning: #b7791f;
  --app-danger: #b42318;
  --app-gold: #ca8a04;
  --app-radius: 8px;
  --app-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --app-shadow-md: 0 8px 22px rgba(15, 23, 42, 0.08);
  --app-focus: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

html {
  background: var(--app-bg);
}

body.admin-shell {
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

body.admin-shell a,
body.admin-shell button,
body.admin-shell .btn,
body.admin-shell [data-bs-toggle],
body.admin-shell [data-record],
body.admin-shell summary {
  cursor: pointer;
}

body.admin-shell a:focus-visible,
body.admin-shell button:focus-visible,
body.admin-shell .btn:focus-visible,
body.admin-shell .form-control:focus,
body.admin-shell .form-select:focus,
body.admin-shell textarea:focus {
  border-color: #77bdb4;
  box-shadow: var(--app-focus);
  outline: 0;
}

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

.app-sidebar {
  padding: 18px 14px;
  background: var(--app-sidebar);
  border-right: 1px solid #1f2937;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand-block {
  min-height: 52px;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
}

.brand-block strong {
  font-size: 14px;
  letter-spacing: 0;
}

.brand-block small {
  margin-top: 2px;
  font-size: 11px;
}

.nav-section {
  gap: 3px;
  margin: 0 0 8px;
}

.nav-section + .nav-section {
  padding-top: 8px;
}

.nav-section-title {
  min-height: 24px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 0;
}

.app-sidebar .nav-link {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #cbd5e1;
  font-weight: 700;
}

.app-sidebar .nav-link:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: #1e293b;
}

.app-sidebar .nav-link.active {
  border-color: rgba(202, 138, 4, 0.42);
  background: #263241;
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--app-gold);
}

.app-sidebar .nav-link i {
  color: #99f6e4;
}

.app-sidebar .nav-link.active i {
  color: #fde68a;
}

.sidebar-note {
  position: static;
  margin-top: 12px;
  padding: 12px;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.5);
}

.sidebar-note i {
  background: rgba(20, 184, 166, 0.14);
  color: #99f6e4;
}

.app-main {
  padding: 22px 24px 40px;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: -22px -24px 18px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(244, 246, 248, 0.96);
  backdrop-filter: blur(10px);
}

.page-heading {
  min-width: 220px;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

.page-kicker i {
  color: var(--app-primary);
}

.main-header h1 {
  margin-top: 3px;
  color: var(--app-text);
  font-size: 25px;
  font-weight: 850;
  line-height: 1.18;
}

.page-heading small {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
}

.header-actions {
  gap: 10px;
}

.admin-chip {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--app-line);
  background: #fff;
  color: #334155;
  box-shadow: none;
}

.period-form {
  min-height: 34px;
}

.period-form .form-control,
.filter-field .form-control,
.filter-field .form-select,
.form-control,
.form-select {
  min-height: 36px;
  border-color: var(--app-line-strong);
  border-radius: 7px;
  color: var(--app-text);
  font-size: 13px;
}

.btn {
  min-height: 34px;
  border-radius: 7px;
  box-shadow: none;
}

.btn-primary {
  --bs-btn-bg: var(--app-blue);
  --bs-btn-border-color: var(--app-blue);
  --bs-btn-hover-bg: #172f73;
  --bs-btn-hover-border-color: #172f73;
  --bs-btn-active-bg: #172f73;
  --bs-btn-active-border-color: #172f73;
}

.btn-outline-primary {
  --bs-btn-color: var(--app-blue);
  --bs-btn-border-color: #9aaad6;
  --bs-btn-hover-bg: #eef3ff;
  --bs-btn-hover-border-color: #6d80c1;
  --bs-btn-hover-color: #172f73;
}

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

.metric-card {
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-left: 4px solid var(--app-primary);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

.metric-card:nth-child(2n) {
  border-left-color: var(--app-blue);
}

.metric-card:nth-child(3n) {
  border-left-color: var(--app-gold);
}

.metric-card:nth-child(5n) {
  border-left-color: var(--app-success);
}

.metric-card span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  margin: 8px 0 4px;
  font-size: 23px;
  font-weight: 850;
}

.metric-card small {
  color: #64748b;
  font-size: 12px;
}

.panel-card {
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow-sm);
}

.panel-card + .panel-card,
.panel-card + .dashboard-grid,
.dashboard-grid + .panel-card,
.kpi-grid + .panel-card {
  margin-top: 14px;
}

.dashboard-grid {
  gap: 14px;
}

.panel-title {
  min-height: 34px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.panel-title small {
  margin: 0 0 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.panel-title h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #f8fafc;
}

.filter-field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.filter-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.filter-actions {
  align-self: end;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.table-responsive {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  margin-bottom: 0;
  font-size: 13px;
}

.page-employees .data-table {
  min-width: 1360px;
}

.page-users .data-table,
.page-wecom .data-table,
.page-roi .data-table {
  min-width: 1240px;
}

.page-transactions .data-table,
.page-expenses .data-table,
.page-payroll .data-table {
  min-width: 1120px;
}

.data-table :is(th, td) {
  max-width: 260px;
}

.data-table :is(th, td):not(.actions-cell):not(.text-end) {
  white-space: normal;
}

.data-table thead th,
.summary-table thead th {
  max-width: none;
  white-space: nowrap !important;
}

.data-table small,
.data-table .text-muted,
.data-table .subtle-link {
  overflow-wrap: anywhere;
}

.data-table thead th,
.summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--app-line);
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

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

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table td strong,
.summary-table td strong {
  color: #111827;
}

.actions-cell {
  min-width: 172px;
  width: 1%;
  white-space: nowrap;
  gap: 6px;
}

.actions-cell form {
  display: inline-flex;
}

.actions-cell .btn {
  min-height: 28px;
  padding: 3px 7px;
  font-size: 12px;
}

.status-badge,
.attachment-pill,
.permission-tags span {
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  color: color-mix(in srgb, var(--badge-color, var(--app-primary)) 76%, #111827);
  background: color-mix(in srgb, var(--badge-color, var(--app-primary)) 13%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--badge-color, var(--app-primary)) 30%, #ffffff);
}

.alert-row {
  border-radius: var(--app-radius);
  border: 1px solid #e5e7eb;
  background: #fff;
}

.alert-row.warning {
  border-color: #f6d38b;
  background: #fffbeb;
}

.alert-row.danger {
  border-color: #f0aaa6;
  background: #fff5f5;
}

.alert-row.info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.employee-card,
.option-category,
.deployment-check-row,
.role-card,
.wecom-staff-card,
.attachment-card {
  border-radius: var(--app-radius);
  border-color: var(--app-line);
  box-shadow: none;
}

.form-grid {
  gap: 12px;
}

.form-label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.form-label input,
.form-label select,
.form-label textarea {
  margin-top: 5px;
}

.modal-content {
  border-radius: 9px;
  border-color: var(--app-line);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #f8fafc;
}

.modal-title {
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

.permission-category,
.permission-group,
.role-template-panel,
.permission-adjustment-block {
  border-color: var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: none;
}

.permission-tags {
  align-items: flex-start;
}

.permission-tags span {
  max-width: 100%;
  line-height: 1.35;
  white-space: normal;
}

.permission-tags.compact {
  max-width: 360px;
}

.permission-tags.compact span {
  max-width: 168px;
}

.page-users .data-table td:nth-child(7) {
  min-width: 260px;
  max-width: 360px;
}

.page-users .data-table td:nth-child(10) {
  min-width: 120px;
  max-width: 180px;
}

.empty-state {
  min-height: 180px;
  border-color: var(--app-line-strong);
  background: #f8fafc;
}

.empty-state.empty-state-compact {
  min-height: 116px;
  margin-top: 12px;
  padding: 18px;
}

.empty-state i {
  color: var(--app-blue);
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .app-sidebar {
    padding: 14px 10px;
  }

  .brand-block {
    justify-content: center;
    padding: 6px;
  }
}

@media (max-width: 860px) {
  .main-header {
    position: static;
    margin: -16px -16px 14px;
    padding: 14px 16px;
  }

  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .btn {
    flex: 1;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .data-table {
    min-width: 760px;
  }
}

@media (max-width: 560px) {
  body.admin-shell {
    font-size: 13px;
  }

  .app-main {
    padding: 12px;
  }

  .main-header {
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .main-header h1 {
    font-size: 22px;
  }

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

  .metric-card {
    min-height: 96px;
    padding: 11px;
  }

  .metric-card strong {
    font-size: 19px;
  }

  .panel-card {
    padding: 12px;
  }

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

  .wecom-sidebar-entry .app-sidebar {
    background: var(--app-sidebar);
  }
}

/* Admin UI refinement pass: compact operations console */
body.admin-shell {
  --ui-row-hover: #f8fbff;
  --ui-header-bg: #f8fafc;
  --ui-soft-blue: #eff6ff;
  --ui-soft-gold: #fffbeb;
  --ui-soft-teal: #f0fdfa;
  overflow-x: clip;
}

body.admin-shell .app-main {
  max-width: 100%;
  min-width: 0;
}

body.admin-shell .main-header {
  min-height: 78px;
  min-width: 0;
}

body.admin-shell .page-heading small {
  max-width: 760px;
  line-height: 1.45;
}

body.admin-shell .header-actions .btn,
body.admin-shell .header-actions .admin-chip,
body.admin-shell .period-form .form-control {
  flex: 0 0 auto;
}

body.admin-shell .btn i {
  font-size: 14px;
  line-height: 1;
}

body.admin-shell .btn.is-submitting,
body.admin-shell button.is-submitting {
  pointer-events: none;
  opacity: 0.78;
}

body.admin-shell .submit-spinner {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -0.12em;
  animation: submit-spin 0.7s linear infinite;
}

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

body.admin-shell .btn-outline-danger {
  --bs-btn-color: #b42318;
  --bs-btn-border-color: #efb6b2;
  --bs-btn-hover-bg: #fff5f5;
  --bs-btn-hover-border-color: #e79a95;
  --bs-btn-hover-color: #8f1f17;
}

body.admin-shell .danger-delete-form {
  flex: 0 0 auto;
}

body.admin-shell .btn-outline-secondary {
  --bs-btn-color: #475569;
  --bs-btn-border-color: #cbd5e1;
  --bs-btn-hover-bg: #f8fafc;
  --bs-btn-hover-border-color: #94a3b8;
  --bs-btn-hover-color: #0f172a;
}

body.admin-shell .panel-card {
  overflow: hidden;
}

body.admin-shell .panel-title {
  gap: 12px;
}

body.admin-shell .panel-title > div {
  min-width: 0;
}

body.admin-shell .panel-title h2 {
  overflow-wrap: anywhere;
}

body.admin-shell .panel-title .btn {
  flex: 0 0 auto;
}

body.admin-shell .filter-toolbar {
  grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(142px, 1fr));
}

body.admin-shell .filter-actions .btn {
  min-width: 76px;
}

body.admin-shell .table-responsive {
  scrollbar-color: #94a3b8 #eef2f7;
}

body.admin-shell .table-responsive::-webkit-scrollbar {
  height: 10px;
}

body.admin-shell .table-responsive::-webkit-scrollbar-thumb {
  border: 2px solid #eef2f7;
  border-radius: 999px;
  background: #94a3b8;
}

body.admin-shell .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

body.admin-shell .data-table thead th {
  height: 38px;
  vertical-align: middle;
}

body.admin-shell .data-table tbody td {
  height: 46px;
}

body.admin-shell .data-table :is(th, td) {
  border-bottom-width: 1px;
}

body.admin-shell .data-table tbody tr:last-child td {
  border-bottom-width: 0;
}

body.admin-shell .data-table tbody tr:hover {
  background: var(--ui-row-hover);
}

body.admin-shell .data-table small {
  display: inline-block;
  max-width: 100%;
  color: #64748b;
  line-height: 1.45;
}

body.admin-shell .data-table code,
body.admin-shell .deployment-check-row code {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}

body.admin-shell .actions-cell {
  align-items: center;
  justify-content: flex-start;
  min-width: 156px;
}

body.admin-shell .actions-cell .btn {
  min-width: 44px;
}

body.admin-shell .actions-cell form {
  flex: 0 0 auto;
}

body.admin-shell .status-badge {
  gap: 4px;
  line-height: 1.25;
}

body.admin-shell .attachment-pill {
  border: 1px solid #b7d8d3;
  background: var(--ui-soft-teal);
}

body.admin-shell .relation-link,
body.admin-shell .subtle-link {
  overflow-wrap: anywhere;
}

body.admin-shell .alert-row {
  min-width: 0;
}

body.admin-shell .alert-row > div {
  min-width: 0;
}

body.admin-shell .btn:disabled,
body.admin-shell .btn.disabled,
body.admin-shell fieldset:disabled .btn {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.2);
}

body.admin-shell .alert-row span,
body.admin-shell .alert-row small,
body.admin-shell .form-note,
body.admin-shell .score-card p,
body.admin-shell .role-side-summary {
  overflow-wrap: anywhere;
}

body.admin-shell .metric-card {
  position: relative;
}

body.admin-shell .metric-card strong {
  overflow-wrap: anywhere;
}

body.admin-shell .metric-card small {
  min-height: 34px;
}

.page-users .dashboard-grid {
  grid-template-columns: minmax(0, 2.35fr) minmax(320px, 1fr);
}

.page-users .dashboard-grid > .panel-card {
  grid-column: 1 / -1;
}

.page-users .data-table {
  min-width: 1480px;
}

.page-users .data-table th:nth-child(1),
.page-users .data-table td:nth-child(1) {
  min-width: 112px;
}

.page-users .data-table th:nth-child(2),
.page-users .data-table td:nth-child(2) {
  min-width: 112px;
}

.page-users .data-table th:nth-child(3),
.page-users .data-table td:nth-child(3) {
  min-width: 150px;
  max-width: 190px;
}

.page-users .data-table th:nth-child(4),
.page-users .data-table td:nth-child(4),
.page-users .data-table th:nth-child(5),
.page-users .data-table td:nth-child(5),
.page-users .data-table th:nth-child(6),
.page-users .data-table td:nth-child(6) {
  min-width: 160px;
}

.page-users .data-table th:nth-child(7),
.page-users .data-table td:nth-child(7) {
  min-width: 330px;
  max-width: 430px;
}

.page-users .data-table th:nth-child(8),
.page-users .data-table td:nth-child(8) {
  min-width: 170px;
}

.page-users .data-table th:nth-child(9),
.page-users .data-table td:nth-child(9) {
  min-width: 88px;
}

.page-users .data-table th:nth-child(10),
.page-users .data-table td:nth-child(10) {
  min-width: 150px;
  max-width: 220px;
}

.page-users .permission-tags.compact {
  max-width: none;
}

.page-users .permission-tags.compact span {
  max-width: 150px;
}

.page-users .settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.page-users .settings-group {
  display: grid;
  align-content: start;
  gap: 8px;
}

.page-users .role-title-row,
.page-users .role-stats,
.page-users .permission-tags,
.page-users .settings-group .d-flex {
  min-width: 0;
}

.page-users .role-side-summary {
  margin: 4px 0;
}

.page-wecom .dashboard-grid,
.page-roi .dashboard-grid,
.page-payroll .dashboard-grid,
.page-expenses .dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
}

.page-wecom .dashboard-grid {
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.68fr);
}

.page-wecom .dashboard-grid > .panel-card.span-2 {
  grid-column: 1 / -1;
}

.page-wecom .data-table,
.page-roi .data-table {
  min-width: 1360px;
}

.page-wecom .dashboard-grid + .dashboard-grid .data-table {
  min-width: 980px;
}

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

.page-vouchers .attachment-card {
  min-height: 132px;
}

.page-vouchers .attachment-actions {
  justify-content: flex-start;
}

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

.modal .permission-category {
  padding: 14px;
  background: #f8fafc;
}

.modal .permission-category-title {
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.modal .permission-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.modal .permission-group {
  padding: 12px;
  background: #fff;
}

.modal .permission-group strong {
  align-items: center;
  min-height: 28px;
}

.modal .permission-group div {
  gap: 7px;
}

.modal .permission-group label {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
}

.modal .permission-group label:has(input:checked) {
  border-color: #93c5fd;
  background: var(--ui-soft-blue);
  color: #1e3a8a;
}

.modal .permission-adjustment-block summary {
  min-height: 42px;
  background: #f8fafc;
}

.modal .user-permission-adjustments {
  align-items: start;
}

.modal .role-template-panel {
  background: var(--ui-soft-blue);
}

.modal .tier-edit-table {
  min-width: 760px;
}

.modal .tier-edit-table input,
.modal .tier-edit-table select {
  min-width: 110px;
}

.modal .tier-card-list {
  margin-top: 2px;
}

.modal .tier-edit-card .form-control,
.modal .tier-edit-card .form-select {
  min-width: 0;
}

.modal .form-grid {
  align-items: start;
}

.modal textarea.form-control {
  min-height: 86px;
}

@media (max-width: 1180px) {
  .page-users .dashboard-grid,
  .page-wecom .dashboard-grid,
  .page-roi .dashboard-grid,
  .page-payroll .dashboard-grid,
  .page-expenses .dashboard-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .main-header {
    align-items: flex-start;
  }

  body.admin-shell .header-actions {
    max-width: 520px;
  }
}

@media (max-width: 860px) {
  body.admin-shell .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid #1f2937;
  }

  body.admin-shell .brand-block {
    width: auto;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 4px 6px;
    margin: 0;
  }

  body.admin-shell .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  body.admin-shell .brand-block span:last-child,
  body.admin-shell .nav-section-title,
  body.admin-shell .sidebar-note {
    display: none;
  }

  body.admin-shell .nav-section {
    width: auto;
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.admin-shell .app-sidebar .nav-link {
    min-height: 34px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0 10px;
  }

  body.admin-shell .app-sidebar .nav-link span {
    display: inline;
  }

  body.admin-shell .main-header {
    min-height: 0;
  }

  body.admin-shell .header-actions {
    max-width: none;
  }

  body.admin-shell .header-actions .admin-chip,
  body.admin-shell .header-actions .btn,
  body.admin-shell .period-form {
    width: 100%;
  }

  body.admin-shell .period-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.admin-shell .data-table {
    min-width: 840px;
  }

  .page-users .data-table,
  .page-employees .data-table,
  .page-wecom .data-table,
  .page-roi .data-table {
    min-width: 1080px;
  }

  .modal .permission-category-grid,
  .modal .user-permission-adjustments {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body.admin-shell .app-sidebar .nav-link {
    padding: 0 9px;
  }

  body.admin-shell .app-sidebar .nav-link span {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.admin-shell .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body.admin-shell .kpi-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .metric-card small {
    min-height: 0;
  }

  body.admin-shell .modal-dialog {
    --bs-modal-margin: 8px;
  }

  body.admin-shell .modal-header,
  body.admin-shell .modal-footer,
  body.admin-shell .modal-body {
    padding: 12px;
  }

  body.admin-shell .actions-cell {
    min-width: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-shell *,
  body.admin-shell *::before,
  body.admin-shell *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Practical layout fixes: keep dense admin pages readable instead of squeezed */
body.admin-shell {
  overflow-x: hidden;
}

body.admin-shell .app-frame {
  grid-template-columns: minmax(236px, 268px) minmax(0, 1fr);
}

body.admin-shell .app-main,
body.admin-shell .panel-card,
body.admin-shell .dashboard-grid,
body.admin-shell .kpi-grid,
body.admin-shell .settings-grid,
body.admin-shell .rule-grid,
body.admin-shell .form-grid,
body.admin-shell .filter-toolbar,
body.admin-shell .modal-content {
  min-width: 0;
}

body.admin-shell .main-header,
body.admin-shell .panel-title,
body.admin-shell .header-actions,
body.admin-shell .filter-actions,
body.admin-shell .actions-cell,
body.admin-shell .d-flex {
  min-width: 0;
}

body.admin-shell .main-header,
body.admin-shell .panel-title {
  flex-wrap: wrap;
}

body.admin-shell .main-header > *,
body.admin-shell .panel-title > * {
  min-width: 0;
}

body.admin-shell .panel-title > div,
body.admin-shell .page-heading {
  flex: 1 1 280px;
}

body.admin-shell .panel-title .btn,
body.admin-shell .panel-title a.btn,
body.admin-shell .header-actions .btn,
body.admin-shell .header-actions .admin-chip {
  max-width: 100%;
  white-space: normal;
}

body.admin-shell .dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

body.admin-shell .dashboard-grid > .span-2,
body.admin-shell .dashboard-grid > .panel-card.span-2,
.page-users .dashboard-grid > .panel-card {
  grid-column: span 2;
}

body.admin-shell .filter-toolbar {
  grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(170px, 1fr));
}

body.admin-shell .filter-field,
body.admin-shell .filter-field .form-control,
body.admin-shell .filter-field .form-select,
body.admin-shell .form-label,
body.admin-shell .form-control,
body.admin-shell .form-select,
body.admin-shell textarea {
  min-width: 0;
  max-width: 100%;
}

body.admin-shell .table-responsive {
  width: 100%;
  max-width: 100%;
}

body.admin-shell .data-table {
  table-layout: auto;
}

body.admin-shell .data-table :is(th, td) {
  min-width: 88px;
  max-width: 280px;
  overflow-wrap: anywhere;
}

body.admin-shell .data-table .actions-cell,
body.admin-shell .data-table td.actions-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  min-width: 150px;
  max-width: 220px;
  background: #fff;
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.04);
}

body.admin-shell .actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
}

body.admin-shell .actions-cell .btn,
body.admin-shell .actions-cell form {
  flex: 0 0 auto;
}

body.admin-shell .actions-cell .quick-order-form {
  flex: 0 1 188px;
}

body.admin-shell .modal-dialog {
  max-width: min(var(--bs-modal-width, 920px), calc(100vw - 32px));
}

body.admin-shell .modal .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

body.admin-shell .modal .form-grid .span-2,
body.admin-shell .modal .form-grid .section-divider,
body.admin-shell .modal .form-grid .form-note {
  grid-column: 1 / -1;
}

.wecom-sync-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: var(--app-radius);
  background: #eff6ff;
}

.wecom-sync-panel[hidden] {
  display: none;
}

.wecom-sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.wecom-sync-head strong,
.wecom-sync-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wecom-sync-head span {
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 800;
}

.wecom-sync-head span[data-tone="success"] {
  color: #166534;
}

.wecom-sync-head span[data-tone="danger"] {
  color: #b42318;
}

.wecom-sync-head span[data-tone="warning"] {
  color: #92400e;
}

.wecom-sync-panel .progress {
  height: 8px;
  background: #dbeafe;
}

.wecom-sync-panel .progress-bar {
  background: var(--app-primary);
  transition: width 0.22s ease;
}

.wecom-sync-log {
  display: grid;
  gap: 6px;
  max-height: 168px;
  overflow: auto;
  padding-right: 4px;
}

.wecom-sync-log-item {
  padding: 7px 9px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wecom-sync-log-item.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.wecom-sync-log-item.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.wecom-sync-log-item.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.approval-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-kpi-grid {
  margin: 12px 0;
}

.reimbursement-card-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}

.reimbursement-account-chip,
.reimbursement-proof-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reimbursement-account-chip i,
.reimbursement-proof-status i {
  flex: 0 0 auto;
}

.reimbursement-account-chip.missing,
.reimbursement-proof-status.missing {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.reimbursement-proof-status.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.reimbursement-self-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.reimbursement-self-panel > i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1e3a8a;
  color: #fff;
  font-size: 20px;
}

.reimbursement-self-panel div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reimbursement-self-panel small,
.reimbursement-self-panel span {
  color: #475569;
  overflow-wrap: anywhere;
}

.reimbursement-self-panel strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.reimbursement-entry-grid .form-control,
.reimbursement-entry-grid .form-select,
.reimbursement-entry-grid .btn {
  min-height: 44px;
}

.reimbursement-proof-field .form-text {
  display: block;
  margin-top: 4px;
}

@media (max-width: 1280px) {
  body.admin-shell .app-frame {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  body.admin-shell .app-main {
    padding: 18px;
  }

  body.admin-shell .main-header {
    margin: -18px -18px 18px;
    padding: 18px;
  }

  body.admin-shell .dashboard-grid,
  .page-wecom .dashboard-grid,
  .page-roi .dashboard-grid,
  .page-payroll .dashboard-grid,
  .page-expenses .dashboard-grid,
  .page-users .dashboard-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .dashboard-grid > .span-2,
  body.admin-shell .dashboard-grid > .panel-card.span-2,
  .page-users .dashboard-grid > .panel-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  body.admin-shell .app-frame {
    display: block;
  }

  body.admin-shell .app-main {
    padding: 14px;
  }

  body.admin-shell .main-header {
    margin: -14px -14px 14px;
  }

  body.admin-shell .filter-toolbar {
    grid-template-columns: 1fr;
  }

  body.admin-shell .filter-actions,
  body.admin-shell .header-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.admin-shell .filter-actions .btn,
  body.admin-shell .header-actions .btn,
  body.admin-shell .header-actions .admin-chip,
  body.admin-shell .period-form {
    width: 100%;
  }

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

@media (max-width: 560px) {
  body.admin-shell .app-main {
    padding: 10px;
  }

  body.admin-shell .main-header {
    margin: -10px -10px 12px;
  }

  body.admin-shell .panel-card {
    padding: 10px;
  }

  body.admin-shell .panel-title > div,
  body.admin-shell .page-heading {
    flex-basis: 100%;
  }

  body.admin-shell .data-table {
    min-width: 760px;
  }

  .page-users .data-table,
  .page-employees .data-table,
  .page-wecom .data-table,
  .page-roi .data-table {
    min-width: 940px;
  }

  body.admin-shell .modal .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Final responsive pass: dense data tables become readable cards in narrow workspaces. */
body.admin-shell .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

body.admin-shell .table-responsive::-webkit-scrollbar,
body.admin-shell .wecom-sync-log::-webkit-scrollbar,
body.admin-shell .app-sidebar::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

body.admin-shell .table-responsive::-webkit-scrollbar-thumb,
body.admin-shell .wecom-sync-log::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #b7c4d2;
}

body.admin-shell .app-sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

body.admin-shell .app-sidebar::-webkit-scrollbar-thumb {
  border: 2px solid var(--app-sidebar);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
}

@media (max-width: 920px) {
  body.admin-shell .app-sidebar {
    overflow-x: auto;
  }

  body.admin-shell .main-header {
    align-items: stretch;
  }

  body.admin-shell .page-heading,
  body.admin-shell .header-actions {
    width: 100%;
  }

  body.admin-shell .page-heading h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  body.admin-shell .panel-card {
    padding: 14px;
  }

  body.admin-shell .panel-title {
    gap: 10px;
  }

  body.admin-shell .filter-toolbar {
    padding: 12px;
  }

  body.admin-shell .table-responsive {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  body.admin-shell .data-table.responsive-card-table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  body.admin-shell .data-table.responsive-card-table thead {
    display: none;
  }

  body.admin-shell .data-table.responsive-card-table tbody,
  body.admin-shell .data-table.responsive-card-table tr,
  body.admin-shell .data-table.responsive-card-table td {
    display: block;
    width: 100%;
  }

  body.admin-shell .data-table.responsive-card-table tbody tr {
    position: relative;
    z-index: 1;
    padding: 10px 12px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow-sm);
  }

  body.admin-shell .data-table.responsive-card-table tbody tr:hover {
    background: #fff;
  }

  body.admin-shell .pagination-bar + .table-responsive {
    margin-top: 12px;
  }

  body.admin-shell .table-responsive + .pagination-bar {
    margin-top: 18px;
  }

  body.admin-shell .data-table.responsive-card-table td {
    min-width: 0 !important;
    max-width: none !important;
    padding: 7px 0;
    border: 0;
    color: var(--app-text);
    text-align: left !important;
    white-space: normal;
  }

  body.admin-shell .data-table.responsive-card-table td:not(.responsive-empty-cell):not(.actions-cell) {
    display: grid;
    grid-template-columns: minmax(88px, 30%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body.admin-shell .data-table.responsive-card-table td:not(.responsive-empty-cell)::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-shell .data-table.responsive-card-table td.responsive-empty-cell::before,
  body.admin-shell .data-table.responsive-card-table td[data-label=""]::before {
    content: none;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell,
  body.admin-shell .data-table.responsive-card-table td.actions-cell:last-child {
    position: static !important;
    right: auto;
    z-index: auto;
    min-width: 0 !important;
    max-width: none !important;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #eef2f6;
    background: transparent;
    box-shadow: none;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell::before {
    content: attr(data-label);
    flex: 0 0 100%;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell .btn,
  body.admin-shell .data-table.responsive-card-table td.actions-cell form {
    flex: 0 1 auto;
  }
}

@media (min-width: 641px) and (max-width: 920px) {
  body.admin-shell .app-frame {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body.admin-shell .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
  }

  body.admin-shell .brand-block {
    width: auto;
    justify-content: center;
    margin: 0 0 12px;
  }

  body.admin-shell .brand-block span:last-child,
  body.admin-shell .app-sidebar .nav-link span,
  body.admin-shell .nav-section-title span,
  body.admin-shell .sidebar-note {
    display: none;
  }

  body.admin-shell .nav-section {
    width: auto;
    display: grid;
    flex: 0 0 auto;
    gap: 2px;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
  }

  body.admin-shell .nav-section + .nav-section {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  body.admin-shell .nav-section-title,
  body.admin-shell .app-sidebar .nav-link {
    justify-content: center;
  }

  body.admin-shell .nav-section-title {
    min-height: 28px;
    padding: 0;
  }

  body.admin-shell .app-sidebar .nav-link {
    min-height: 38px;
    flex: 0 0 auto;
    margin: 0 0 5px;
    padding: 0;
  }

  body.admin-shell .app-main {
    padding: 14px;
  }

  body.admin-shell .main-header {
    margin: 0 0 14px;
  }

  body.admin-shell .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .header-actions .admin-chip,
  body.admin-shell .header-actions .btn,
  body.admin-shell .header-actions form {
    width: 100%;
  }
}

/* 2026-06 live layout guard: keep dense pages usable instead of squeezed. */
body.admin-shell {
  overflow-x: hidden;
}

body.admin-shell .app-frame,
body.admin-shell .app-main,
body.admin-shell .panel-card,
body.admin-shell .dashboard-grid,
body.admin-shell .kpi-grid,
body.admin-shell .settings-grid,
body.admin-shell .table-responsive,
body.admin-shell .modal-content {
  min-width: 0;
}

body.admin-shell .live-status-chip {
  gap: 7px;
  color: #0f766e;
  font-weight: 800;
}

body.admin-shell .live-status-chip time {
  min-width: 64px;
  font-variant-numeric: tabular-nums;
}

body.admin-shell .icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

body.admin-shell .icon-text-btn.is-refreshing i {
  animation: finance-spin 0.8s linear infinite;
}

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

body.admin-shell .header-actions > form,
body.admin-shell .header-actions > .btn,
body.admin-shell .header-actions > .admin-chip {
  min-width: 0;
}

body.admin-shell .pagination-bar {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

body.admin-shell .pagination-summary {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 750;
}

body.admin-shell .pagination-actions,
body.admin-shell .pagination-size {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

body.admin-shell .page-chip,
body.admin-shell .pagination-size a {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--app-text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

body.admin-shell .page-chip.active,
body.admin-shell .pagination-size a.active {
  border-color: var(--app-primary);
  background: color-mix(in srgb, var(--app-primary) 12%, #ffffff);
  color: var(--app-primary-dark);
}

body.admin-shell .page-chip.muted {
  min-width: 20px;
  border-color: transparent;
  background: transparent;
  color: var(--app-muted);
}

body.admin-shell .pagination-bar .disabled {
  pointer-events: none;
  opacity: 0.46;
}

body.admin-shell .panel-title {
  flex-wrap: wrap;
  align-items: flex-start;
}

body.admin-shell .panel-title > div:first-child {
  min-width: min(100%, 260px);
}

body.admin-shell .panel-title h2,
body.admin-shell .page-heading h1,
body.admin-shell .page-heading small,
body.admin-shell .admin-chip,
body.admin-shell .btn,
body.admin-shell .form-note,
body.admin-shell .alert-row span,
body.admin-shell .alert-row strong,
body.admin-shell .data-table td,
body.admin-shell .data-table small {
  overflow-wrap: anywhere;
}

body.admin-shell .data-table td {
  white-space: normal;
}

body.admin-shell .data-table th {
  white-space: nowrap;
}

body.admin-shell .avatar-name {
  min-width: 0;
}

body.admin-shell .avatar-name > div,
body.admin-shell .employee-card > div,
body.admin-shell .score-card > div,
body.admin-shell .role-card,
body.admin-shell .option-row,
body.admin-shell .attachment-card {
  min-width: 0;
}

.page-customers .data-table,
.page-wecom .data-table,
.page-roi .data-table,
.page-payroll .data-table,
.page-users .data-table {
  min-width: 980px;
}

@media (min-width: 921px) and (max-width: 1180px) {
  body.admin-shell .app-frame {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  body.admin-shell .app-sidebar {
    padding: 12px 8px;
    overflow-y: auto;
  }

  body.admin-shell .brand-block {
    justify-content: center;
    margin-bottom: 12px;
  }

  body.admin-shell .brand-block span:last-child,
  body.admin-shell .app-sidebar .nav-link span,
  body.admin-shell .nav-section-title span,
  body.admin-shell .sidebar-note {
    display: none;
  }

  body.admin-shell .nav-section {
    margin-bottom: 10px;
  }

  body.admin-shell .nav-section-title,
  body.admin-shell .app-sidebar .nav-link {
    justify-content: center;
  }

  body.admin-shell .app-sidebar .nav-link {
    padding: 0;
  }

  body.admin-shell .main-header {
    align-items: stretch;
    margin: -18px -18px 18px;
    padding: 16px 18px;
  }
}

@media (min-width: 721px) and (max-width: 1180px) {
  body.admin-shell.simple-role-shell .app-frame {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  body.admin-shell.simple-role-shell .app-sidebar {
    padding: 12px 10px;
  }

  body.admin-shell.simple-role-shell .brand-block {
    justify-content: flex-start;
    padding: 0 8px;
  }

  body.admin-shell.simple-role-shell .brand-block span:last-child,
  body.admin-shell.simple-role-shell .app-sidebar .nav-link span,
  body.admin-shell.simple-role-shell .nav-section-title span {
    display: block;
  }

  body.admin-shell.simple-role-shell .nav-section-title,
  body.admin-shell.simple-role-shell .app-sidebar .nav-link {
    justify-content: flex-start;
  }

  body.admin-shell.simple-role-shell .app-sidebar .nav-link {
    padding: 0 10px;
  }

  body.admin-shell.simple-role-shell .sidebar-note {
    display: none;
  }
}

@media (max-width: 1180px) {
  body.admin-shell .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body.admin-shell .header-actions .admin-chip,
  body.admin-shell .header-actions .btn,
  body.admin-shell .header-actions form {
    width: 100%;
  }

  body.admin-shell .period-form {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body.admin-shell .period-form .form-control {
    width: 100%;
  }

  body.admin-shell .period-form .btn {
    width: auto;
    min-width: 78px;
  }

  body.admin-shell .table-responsive {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  body.admin-shell .data-table.responsive-card-table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  body.admin-shell .data-table.responsive-card-table thead {
    display: none;
  }

  body.admin-shell .data-table.responsive-card-table tbody,
  body.admin-shell .data-table.responsive-card-table tr,
  body.admin-shell .data-table.responsive-card-table td {
    display: block;
    width: 100%;
  }

  body.admin-shell .data-table.responsive-card-table tbody tr {
    position: relative;
    z-index: 1;
    padding: 10px 12px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow-sm);
  }

  body.admin-shell .data-table.responsive-card-table td {
    min-width: 0 !important;
    max-width: none !important;
    padding: 7px 0;
    border: 0;
    color: var(--app-text);
    text-align: left !important;
    white-space: normal;
  }

  body.admin-shell .data-table.responsive-card-table td:not(.responsive-empty-cell):not(.actions-cell) {
    display: grid;
    grid-template-columns: minmax(88px, 30%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body.admin-shell .data-table.responsive-card-table td:not(.responsive-empty-cell)::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-shell .data-table.responsive-card-table td.responsive-empty-cell::before,
  body.admin-shell .data-table.responsive-card-table td[data-label=""]::before {
    content: none;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell,
  body.admin-shell .data-table.responsive-card-table td.actions-cell:last-child {
    position: static !important;
    right: auto;
    z-index: auto;
    min-width: 0 !important;
    max-width: none !important;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #eef2f6;
    background: transparent;
    box-shadow: none;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell::before {
    content: attr(data-label);
    flex: 0 0 100%;
    color: var(--app-muted);
    font-size: 12px;
    font-weight: 850;
  }
}

@media (max-width: 720px) {
  body.admin-shell .header-actions {
    grid-template-columns: 1fr;
  }

  body.admin-shell .live-status-chip {
    justify-content: center;
  }

  body.admin-shell .filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.admin-shell .filter-actions .btn,
  body.admin-shell .panel-title .btn,
  body.admin-shell .panel-title a.btn {
    width: 100%;
  }

  body.admin-shell .pagination-bar {
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-customers .customer-mobile-filter + .pagination-bar,
  body.admin-shell.page-vouchers .voucher-mobile-filter + .pagination-bar {
    display: none;
  }

  body.admin-shell .pagination-actions,
  body.admin-shell .pagination-size {
    justify-content: flex-start;
  }

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

  body.admin-shell .metric-card {
    min-height: 112px;
    padding: 12px;
  }

  body.admin-shell .metric-card strong {
    font-size: 20px;
  }

  body.admin-shell .alert-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  body.admin-shell .alert-row i {
    width: 32px;
    height: 32px;
  }

  body.admin-shell .action-list .alert-row .btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

body.admin-shell .customer-task-panel {
  margin-top: 14px;
}

body.admin-shell .dashboard-priority-panel {
  border-color: #cfd9e6;
  background: #ffffff;
}

body.admin-shell .dashboard-priority-panel .panel-title {
  align-items: flex-start;
}

body.admin-shell .dashboard-priority-panel .panel-title .d-flex {
  justify-content: flex-end;
}

body.admin-shell .dashboard-finance-details {
  margin-top: 14px;
}

body.admin-shell .dashboard-finance-details > summary {
  border-color: #d9e2ec;
  background: #ffffff;
}

body.admin-shell .dashboard-finance-details > summary strong {
  color: #111827;
}

body.admin-shell .customer-ops-summary {
  margin-bottom: 14px;
}

body.admin-shell .customer-ops-summary > summary strong {
  overflow-wrap: anywhere;
}

body.admin-shell .customer-ops-summary-body {
  display: grid;
  gap: 12px;
}

body.admin-shell .customer-ops-summary-body .kpi-grid {
  margin-bottom: 0;
}

body.admin-shell .customer-ops-summary-body .customer-task-panel {
  margin-top: 0;
}

body.admin-shell .customer-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

body.admin-shell .customer-mode-switch a {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--app-text);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

body.admin-shell .customer-mode-switch a:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

body.admin-shell .customer-mode-switch a.active {
  border-color: #0f766e;
  background: #f0fdfa;
}

body.admin-shell .customer-mode-switch i {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6f4;
  color: #0f766e;
  font-size: 18px;
}

body.admin-shell .customer-mode-switch span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.admin-shell .customer-mode-switch strong,
body.admin-shell .customer-mode-switch small {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-mode-switch strong {
  font-size: 15px;
  font-weight: 900;
}

body.admin-shell .customer-mode-switch small {
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.35;
}

body.admin-shell .customer-mode-switch em {
  min-width: 30px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

body.admin-shell .customer-flow-panel .panel-title {
  align-items: flex-start;
}

body.admin-shell .customer-title-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

body.admin-shell .customer-stage-tabs,
body.admin-shell .customer-title-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

body.admin-shell .customer-stage-tab {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

body.admin-shell .customer-stage-tab:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}

body.admin-shell .customer-stage-tab em {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

body.admin-shell .customer-stage-tab.warning.active,
body.admin-shell .customer-stage-tab.warning:hover {
  border-color: #f59e0b;
}

body.admin-shell .customer-stage-tab.primary.active,
body.admin-shell .customer-stage-tab.primary:hover {
  border-color: #2563eb;
}

body.admin-shell .customer-stage-tab.success.active,
body.admin-shell .customer-stage-tab.success:hover {
  border-color: #16a34a;
}

body.admin-shell .customer-stage-tab.danger.active,
body.admin-shell .customer-stage-tab.danger:hover {
  border-color: #dc2626;
}

body.admin-shell .customer-stage-tab.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

body.admin-shell .customer-stage-tab.active em {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.admin-shell .customer-flow-note {
  margin-bottom: 12px;
}

body.admin-shell .workflow-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

body.admin-shell .workflow-task-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  color: var(--app-text);
  text-decoration: none;
  background: #fff;
  box-shadow: none;
}

body.admin-shell .workflow-task-card:hover {
  border-color: #b8c3d1;
  background: #f8fafc;
}

body.admin-shell .workflow-task-card span {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .workflow-task-card strong {
  font-size: 26px;
  line-height: 1;
}

body.admin-shell .workflow-task-card small {
  color: var(--app-muted);
  line-height: 1.45;
}

body.admin-shell .workflow-task-card.warning {
  border-left: 4px solid #f59e0b;
}

body.admin-shell .workflow-task-card.primary {
  border-left: 4px solid #2563eb;
}

body.admin-shell .workflow-task-card.success {
  border-left: 4px solid #16a34a;
}

body.admin-shell .workflow-task-card.danger {
  border-left: 4px solid #dc2626;
}

body.admin-shell .service-delivery-panel {
  display: grid;
  gap: 12px;
}

body.admin-shell .service-delivery-metrics {
  margin-bottom: 0;
}

body.admin-shell .service-delivery-filter {
  margin-top: 0;
}

body.admin-shell .service-delivery-list {
  display: grid;
  gap: 10px;
}

body.admin-shell .service-delivery-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe7f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
}

body.admin-shell .service-delivery-card.warning {
  border-left-color: #f59e0b;
}

body.admin-shell .service-delivery-card.primary {
  border-left-color: #2563eb;
}

body.admin-shell .service-delivery-card.success {
  border-left-color: #16a34a;
}

body.admin-shell .service-delivery-card.danger {
  border-left-color: #dc2626;
}

body.admin-shell .service-card-head,
body.admin-shell .service-card-actions {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

body.admin-shell .service-card-head .avatar-name {
  min-width: 0;
}

body.admin-shell .service-card-head .avatar-name strong,
body.admin-shell .service-card-head .avatar-name small {
  overflow-wrap: anywhere;
}

body.admin-shell .service-card-state {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 130px;
}

body.admin-shell .service-card-state .customer-next-step {
  margin-top: 0;
  max-width: 180px;
  text-align: right;
}

body.admin-shell .service-card-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e2e8f0;
}

body.admin-shell .service-card-facts > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  background: #fff;
}

body.admin-shell .service-card-facts dt,
body.admin-shell .service-card-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .service-card-facts dt {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .service-card-facts dd {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 850;
}

body.admin-shell .service-card-facts small {
  display: block;
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

body.admin-shell .service-proof-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-shell .service-card-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

body.admin-shell .service-card-actions .btn,
body.admin-shell .service-card-actions form,
body.admin-shell .service-card-actions details {
  min-width: 0;
}

body.admin-shell .service-card-more > summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

body.admin-shell .service-card-more > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

body.admin-shell .customer-next-step {
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 220px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #e5eaf0;
  background: #f8fafc;
}

body.admin-shell .customer-next-step span {
  color: var(--app-text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

body.admin-shell .customer-next-step small {
  color: var(--app-muted);
  line-height: 1.35;
}

body.admin-shell .customer-next-step.warning {
  border-color: #f3d37c;
  background: #fff8e7;
}

body.admin-shell .customer-next-step.primary {
  border-color: #c7d7fe;
  background: #eef4ff;
}

body.admin-shell .customer-next-step.success {
  border-color: #bde8d0;
  background: #eefaf3;
}

body.admin-shell .customer-next-step.danger {
  border-color: #f2b8b5;
  background: #fff1f1;
}

@media (max-width: 720px) {
  body.admin-shell .report-brief-grid,
  body.admin-shell .profit-brief-grid,
  body.admin-shell .deployment-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .report-brief-grid .brief-metric:last-child,
  body.admin-shell .profit-brief-grid .brief-metric:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  body.admin-shell .kpi-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .data-table.responsive-card-table td:not(.responsive-empty-cell):not(.actions-cell) {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 820px) {
  body.admin-shell .customer-ops-summary > summary {
    align-items: flex-start;
  }

  body.admin-shell .customer-ops-summary .metric-card {
    min-height: 92px;
  }

  body.admin-shell .customer-ops-summary .workflow-task-card {
    min-height: 96px;
    padding: 12px;
  }

  body.admin-shell .customer-ops-summary .workflow-task-card strong {
    font-size: 22px;
  }

  body.admin-shell .workflow-task-grid {
    grid-template-columns: 1fr;
  }
}

/* Company employee ordering: keep quick order controls clear in dense rows. */
body.admin-shell .quick-order-form {
  max-width: 340px;
  flex-wrap: wrap;
}

body.admin-shell .quick-order-form .form-select[name="order_type_value"] {
  width: 118px;
  min-width: 118px;
}

body.admin-shell .quick-order-form .form-select[name="order_employee_id"] {
  width: 120px;
  min-width: 120px;
}

body.admin-shell .quick-order-form .btn {
  flex: 0 0 auto;
}

body.admin-shell .upload-owner-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(140px, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

body.admin-shell .upload-customer-field {
  margin-bottom: 8px;
}

body.admin-shell .upload-customer-summary {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #f8fafc;
}

body.admin-shell .upload-customer-summary[hidden] {
  display: none;
}

body.admin-shell .upload-customer-summary strong {
  min-width: 0;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .upload-customer-summary span,
body.admin-shell .upload-customer-summary small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body.admin-shell .upload-owner-hint {
  margin-bottom: 14px;
  padding: 9px 10px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #f8fafc;
  line-height: 1.45;
}

body.admin-shell .upload-file-preview {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #fff;
}

body.admin-shell .upload-file-preview[hidden] {
  display: none;
}

body.admin-shell .upload-file-preview img,
body.admin-shell .upload-file-preview > i {
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: #f1f5f9;
}

body.admin-shell .upload-file-preview img {
  object-fit: cover;
}

body.admin-shell .upload-file-preview > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-size: 32px;
}

body.admin-shell .upload-file-preview div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body.admin-shell .upload-file-preview strong {
  min-width: 0;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .upload-file-preview small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  body.admin-shell .quick-order-form {
    max-width: none;
  }
}

/* Small-company simplification pass: keep dense data, hide advanced noise. */
body.admin-shell .filter-advanced {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #fff;
}

body.admin-shell .filter-advanced summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

body.admin-shell .filter-advanced summary::-webkit-details-marker {
  display: none;
}

body.admin-shell .filter-advanced summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
}

body.admin-shell .filter-advanced[open] summary {
  border-bottom: 1px solid #e5edf5;
}

body.admin-shell .filter-advanced[open] summary::after {
  content: "收起";
}

body.admin-shell .filter-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 12px;
}

body.admin-shell .row-actions-more {
  flex: 0 0 auto;
  max-width: 100%;
}

body.admin-shell .row-actions-more summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  white-space: nowrap;
}

body.admin-shell .row-actions-more summary::-webkit-details-marker {
  display: none;
}

body.admin-shell .row-actions-more summary:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

body.admin-shell .row-actions-more > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: var(--app-radius);
  background: #f8fafc;
}

body.admin-shell .secondary-section {
  margin-bottom: 16px;
}

body.admin-shell .secondary-section > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #f8fafc;
  color: var(--app-text);
  cursor: pointer;
  list-style: none;
}

body.admin-shell .secondary-section > summary::-webkit-details-marker {
  display: none;
}

body.admin-shell .secondary-section > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.admin-shell .secondary-section > summary small,
body.admin-shell .secondary-section > summary em {
  color: var(--app-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

body.admin-shell .secondary-section > summary strong {
  font-size: 15px;
  font-weight: 850;
}

body.admin-shell .secondary-section > summary em::after {
  content: " ↓";
}

body.admin-shell .secondary-section[open] > summary em::after {
  content: " ↑";
}

body.admin-shell .secondary-section[open] > summary {
  border-color: #cbd5e1;
  background: #fff;
}

body.admin-shell .secondary-section-body {
  margin-top: 12px;
}

body.admin-shell .employee-summary-details,
body.admin-shell .users-security-summary {
  margin-bottom: 12px;
}

body.admin-shell .employee-summary-details .kpi-grid,
body.admin-shell .users-security-summary .kpi-grid {
  margin-bottom: 0;
}

body.admin-shell .employee-flow-note {
  margin-bottom: 12px;
}

body.admin-shell .finance-flow-note {
  margin-bottom: 12px;
}

body.admin-shell .report-brief-panel,
body.admin-shell .profit-brief-panel {
  display: grid;
  gap: 12px;
}

body.admin-shell .report-brief-grid,
body.admin-shell .profit-brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.admin-shell .brief-metric {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-left: 4px solid #1e3a8a;
  border-radius: 8px;
  background: #f8fafc;
}

body.admin-shell .brief-metric.metric-success {
  border-left-color: #15803d;
}

body.admin-shell .brief-metric.metric-danger {
  border-left-color: #dc2626;
}

body.admin-shell .brief-metric.metric-primary {
  border-left-color: #1e40af;
}

body.admin-shell .brief-metric span,
body.admin-shell .brief-metric small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.admin-shell .brief-metric strong {
  color: var(--app-text);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body.admin-shell .report-status-strip {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fafc;
}

body.admin-shell .report-status-strip i {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

body.admin-shell .report-status-strip.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

body.admin-shell .report-status-strip.warning i {
  background: #fef3c7;
  color: #b45309;
}

body.admin-shell .report-status-strip.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

body.admin-shell .report-status-strip.success i {
  background: #dcfce7;
  color: #15803d;
}

body.admin-shell .report-status-strip strong,
body.admin-shell .report-status-strip span {
  display: block;
}

body.admin-shell .report-status-strip span {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 700;
}

body.admin-shell .report-brief-panel + .report-metrics-details {
  margin-top: 14px;
}

body.admin-shell .report-metrics-details .kpi-grid {
  margin-bottom: 0;
}

body.admin-shell .deployment-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.admin-shell .deployment-summary-strip span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fafc;
}

body.admin-shell .deployment-summary-strip strong {
  color: var(--app-text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

body.admin-shell .deployment-summary-strip small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.admin-shell .deployment-summary-strip .ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

body.admin-shell .deployment-summary-strip .warn {
  border-color: #fde68a;
  background: #fffbeb;
}

body.admin-shell .deployment-summary-strip .error {
  border-color: #fecaca;
  background: #fef2f2;
}

body.admin-shell .deployment-grid .deploy-check-section {
  margin-bottom: 0;
}

body.admin-shell .deployment-grid .deploy-check-section:not([open]) > summary {
  margin-bottom: -18px;
  border-bottom: 0;
}

body.admin-shell .deploy-check-section > summary strong {
  overflow-wrap: anywhere;
}

body.admin-shell .panel-card.secondary-section > summary {
  margin: -18px -18px 14px;
  border-width: 0 0 1px;
  border-radius: 8px 8px 0 0;
}

body.admin-shell .modal-secondary-section {
  min-width: 0;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #fbfdff;
}

body.admin-shell .modal-secondary-section > summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--app-text);
  cursor: pointer;
  list-style: none;
}

body.admin-shell .modal-secondary-section > summary::-webkit-details-marker {
  display: none;
}

body.admin-shell .modal-secondary-section > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.admin-shell .modal-secondary-section > summary small,
body.admin-shell .modal-secondary-section > summary em {
  color: var(--app-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

body.admin-shell .modal-secondary-section > summary strong {
  font-size: 15px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

body.admin-shell .modal-secondary-section > summary em {
  flex: 0 0 auto;
}

body.admin-shell .modal-secondary-section > summary em::after {
  content: " ↓";
}

body.admin-shell .modal-secondary-section[open] > summary {
  border-bottom: 1px solid #e5edf5;
  background: #fff;
}

body.admin-shell .modal-secondary-section[open] > summary em::after {
  content: " ↑";
}

body.admin-shell .modal-secondary-section > .form-note {
  margin: 12px 14px 0;
}

body.admin-shell .modal-secondary-grid {
  padding: 12px 14px 14px;
}

body.admin-shell .performance-customer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.8fr);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid #cfe0f3;
  border-radius: var(--app-radius);
  background: #f7fbff;
}

body.admin-shell .performance-customer-summary[hidden] {
  display: none;
}

body.admin-shell .performance-customer-summary small,
body.admin-shell .performance-customer-summary dt {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.admin-shell .performance-customer-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--app-text);
  font-size: 16px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

body.admin-shell .performance-customer-summary span {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

body.admin-shell .performance-customer-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

body.admin-shell .performance-customer-summary dl > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

body.admin-shell .performance-customer-summary dd {
  margin: 3px 0 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

body.admin-shell .performance-entry-modal .modal-title {
  letter-spacing: 0;
}

body.admin-shell .performance-entry-grid {
  gap: 12px;
}

body.admin-shell .performance-customer-field select {
  font-weight: 800;
}

body.admin-shell .performance-assignment-note {
  margin: -2px 0 0;
  border-left: 3px solid var(--app-primary);
}

body.admin-shell .performance-core-field {
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #fbfdff;
}

body.admin-shell .performance-payment-field {
  margin-bottom: 0;
  padding: 12px;
  border: 1px dashed #b8c8dd;
  border-radius: var(--app-radius);
  background: #f8fafc;
}

body.admin-shell .performance-payment-field .form-text {
  display: block;
  margin-top: 6px;
}

body.admin-shell .employee-entry-grid .section-divider {
  margin-bottom: 2px;
}

body.admin-shell .employee-core-field {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #e1eaf3;
  border-radius: var(--app-radius);
  background: #ffffff;
}

body.admin-shell .employee-core-field:focus-within {
  border-color: #9bb8e8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

body.admin-shell .performance-file-preview {
  margin-top: 10px;
  background: #fff;
}

body.admin-shell .quick-flow-note {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #cfe0f3;
  border-radius: var(--app-radius);
  background: #f7fbff;
}

body.admin-shell .quick-flow-note i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--app-primary);
  font-size: 18px;
}

body.admin-shell .quick-flow-note strong,
body.admin-shell .quick-flow-note span {
  display: block;
  min-width: 0;
}

body.admin-shell .quick-flow-note strong {
  color: var(--app-text);
  font-size: 15px;
  font-weight: 850;
}

body.admin-shell .quick-flow-note span {
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 13px;
}

body.admin-shell .quick-flow-note-compact {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
}

body.admin-shell .quick-flow-note-compact i {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

body.admin-shell .quick-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

body.admin-shell .quick-customer-card {
  min-width: 0;
  min-height: 44px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-radius: var(--app-radius);
  background: #fff;
  color: var(--app-text);
  text-decoration: none;
  box-shadow: var(--app-shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

body.admin-shell button.quick-customer-card {
  width: 100%;
  border: 1px solid #dbe7f0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

body.admin-shell .quick-customer-card:hover {
  border-color: #94a3b8;
  background: #fbfdff;
  color: var(--app-text);
  box-shadow: var(--app-shadow-md);
}

body.admin-shell .quick-customer-card.warning {
  border-color: #f2d28d;
}

body.admin-shell .quick-customer-card.success {
  border-color: #b8e0c9;
}

body.admin-shell .quick-customer-card.primary {
  border-color: #c5d7fb;
}

body.admin-shell .quick-customer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body.admin-shell .quick-customer-kicker,
body.admin-shell .quick-customer-card small,
body.admin-shell .quick-customer-card dt {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body.admin-shell .quick-customer-card strong {
  min-width: 0;
  color: var(--app-text);
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .quick-customer-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

body.admin-shell .quick-customer-card dl > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #f8fafc;
}

body.admin-shell .quick-customer-card dt,
body.admin-shell .quick-customer-card dd {
  margin: 0;
}

body.admin-shell .quick-customer-card dd {
  margin-top: 2px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body.admin-shell .quick-customer-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--app-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .payroll-history-details {
  margin-top: 12px;
  margin-bottom: 0;
}

body.admin-shell .payroll-action-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

body.admin-shell .payroll-action-panel .quick-flow-note,
body.admin-shell .payroll-action-panel .quick-customer-grid,
body.admin-shell .payroll-action-panel .alert-row {
  margin-bottom: 0;
}

body.admin-shell .payroll-summary-grid {
  margin-bottom: 0;
}

body.admin-shell .payroll-process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.admin-shell .payroll-process-strip span {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

body.admin-shell .payroll-process-strip i {
  flex: 0 0 auto;
  color: var(--app-primary);
}

body.admin-shell .payroll-reference-details,
body.admin-shell .payroll-ledger-panel {
  margin-bottom: 16px;
}

body.admin-shell .payroll-reference-panel {
  box-shadow: none;
}

body.admin-shell .roi-action-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

body.admin-shell .roi-action-panel .workflow-task-grid {
  margin-top: 0;
}

body.admin-shell .roi-action-panel .workflow-task-card strong {
  overflow-wrap: anywhere;
}

body.admin-shell .roi-summary-details {
  margin-bottom: 16px;
}

body.admin-shell .roi-summary-details .kpi-grid {
  margin-bottom: 14px;
}

body.admin-shell .roi-ad-type-panel {
  box-shadow: none;
}

body.admin-shell .roi-attribution-queue {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

body.admin-shell .roi-attribution-note {
  margin-bottom: 0;
}

body.admin-shell .roi-attribution-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e2e8f0;
}

body.admin-shell .roi-attribution-summary article {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #ffffff;
}

body.admin-shell .roi-attribution-summary span,
body.admin-shell .roi-attribution-summary small {
  color: var(--app-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

body.admin-shell .roi-attribution-summary strong {
  color: var(--app-text);
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .roi-attribution-list {
  display: grid;
  gap: 10px;
}

body.admin-shell .roi-attribution-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe7f0;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  background: #ffffff;
}

body.admin-shell .roi-attribution-card-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.admin-shell .roi-attribution-card-head div {
  min-width: 0;
}

body.admin-shell .roi-attribution-card-head small {
  display: block;
  color: var(--app-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

body.admin-shell .roi-attribution-card-head strong {
  display: block;
  margin-top: 2px;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .roi-attribution-card-head > span {
  flex: 0 0 auto;
  color: #b45309;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

body.admin-shell .roi-attribution-tags,
body.admin-shell .roi-attribution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-shell .roi-attribution-tags em {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

body.admin-shell .roi-attribution-tags em.warning {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

body.admin-shell .roi-attribution-tags em.primary {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

body.admin-shell .roi-attribution-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #e2e8f0;
}

body.admin-shell .roi-attribution-card dl > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  background: #ffffff;
}

body.admin-shell .roi-attribution-card dt,
body.admin-shell .roi-attribution-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .roi-attribution-card dt {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .roi-attribution-card dd {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 750;
}

body.admin-shell .roi-attribution-card dd small {
  display: block;
  margin-top: 2px;
  color: var(--app-muted);
  font-size: 12px;
}

body.admin-shell .roi-attribution-empty {
  margin: 0;
}

body.admin-shell .voucher-quick-note {
  margin-bottom: 12px;
}

body.admin-shell .voucher-customer-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body.admin-shell.page-customers .actions-cell {
  align-items: flex-start;
}

body.admin-shell .customer-row-actions {
  gap: 8px;
}

body.admin-shell .customer-proof-pill {
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid #dbe7f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-proof-pill i {
  flex: 0 0 auto;
  font-size: 13px;
}

body.admin-shell .customer-proof-pill.ready {
  border-color: #b8ead7;
  background: #ecfdf5;
  color: #047857;
}

body.admin-shell .customer-proof-pill.missing {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}

body.admin-shell .customer-action-group {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.admin-shell .customer-action-group:empty {
  display: none;
}

body.admin-shell .customer-action-next {
  padding-bottom: 2px;
}

body.admin-shell .customer-action-next .btn {
  border-width: 1px;
  font-weight: 850;
}

body.admin-shell .customer-action-common .btn {
  flex: 1 1 112px;
}

body.admin-shell .customer-action-more {
  width: 100%;
}

body.admin-shell .customer-action-more > summary {
  width: fit-content;
  color: #64748b;
}

body.admin-shell .customer-action-more[open] > summary {
  border-color: #94a3b8;
  color: #334155;
}

body.admin-shell .customer-detail-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

body.admin-shell .customer-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body.admin-shell .customer-detail-head h2 {
  margin: 2px 0 0;
  color: var(--app-text);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

body.admin-shell .customer-detail-head small,
body.admin-shell .customer-detail-head span {
  display: block;
  color: var(--app-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body.admin-shell .customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--app-radius);
  background: #e2e8f0;
}

body.admin-shell .customer-detail-card {
  min-width: 0;
  padding: 12px;
  background: #fff;
}

body.admin-shell .customer-detail-card span,
body.admin-shell .customer-detail-card small {
  display: block;
  color: var(--app-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  align-items: start;
}

body.admin-shell .customer-profile-list,
body.admin-shell .customer-timeline {
  min-width: 0;
  padding-top: 2px;
}

body.admin-shell .customer-profile-list h3,
body.admin-shell .customer-timeline h3 {
  margin: 0 0 10px;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

body.admin-shell .customer-profile-list dl {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: var(--app-radius);
  background: #e2e8f0;
}

body.admin-shell .customer-profile-list dl > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
}

body.admin-shell .customer-profile-list dt,
body.admin-shell .customer-profile-list dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-profile-list dt {
  color: var(--app-muted);
  font-weight: 850;
}

body.admin-shell .customer-profile-list dd {
  color: var(--app-text);
  font-weight: 750;
}

body.admin-shell .customer-timeline {
  display: grid;
  gap: 8px;
}

body.admin-shell .customer-timeline article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: var(--app-radius);
  background: #fff;
}

body.admin-shell .customer-timeline article > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--app-primary);
}

body.admin-shell .customer-timeline article div {
  min-width: 0;
}

body.admin-shell .customer-timeline strong,
body.admin-shell .customer-timeline span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-timeline strong {
  color: var(--app-text);
  font-size: 14px;
  font-weight: 900;
}

body.admin-shell .customer-timeline span,
body.admin-shell .customer-timeline time {
  color: var(--app-muted);
  font-size: 12px;
}

body.admin-shell .customer-detail-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.admin-shell .customer-detail-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--app-radius);
  background: #ffffff;
}

body.admin-shell .customer-detail-section-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

body.admin-shell .customer-detail-section-head > i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef6f4;
  color: #0f766e;
  font-size: 17px;
}

body.admin-shell .customer-detail-section-head small,
body.admin-shell .customer-detail-section-head h3 {
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-section-head small {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .customer-detail-section-head h3 {
  margin: 2px 0 0;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

body.admin-shell .customer-detail-definition {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #edf2f7;
}

body.admin-shell .customer-detail-definition > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: #ffffff;
}

body.admin-shell .customer-detail-definition dt,
body.admin-shell .customer-detail-definition dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-definition dt {
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 850;
}

body.admin-shell .customer-detail-definition dd {
  color: var(--app-text);
  font-size: 13px;
  font-weight: 760;
}

body.admin-shell .customer-detail-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.admin-shell .customer-detail-mini-actions .btn,
body.admin-shell .customer-detail-mini-actions form {
  min-height: 36px;
}

body.admin-shell .customer-detail-mini-actions form {
  margin: 0;
}

body.admin-shell .customer-detail-safe-note {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 10px;
  padding: 10px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fafc;
}

body.admin-shell .customer-detail-safe-note strong,
body.admin-shell .customer-detail-safe-note span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.admin-shell .customer-detail-safe-note strong {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

body.admin-shell .customer-detail-safe-note span {
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.5;
}

body.admin-shell .mobile-filter-shell {
  margin-bottom: 12px;
}

body.admin-shell .mobile-filter-shell > summary {
  display: none;
}

body.admin-shell .mobile-filter-shell-body {
  display: block;
}

body.admin-shell .customer-mobile-filter {
  margin-bottom: 12px;
}

body.admin-shell .customer-mobile-filter > summary {
  display: none;
}

body.admin-shell .customer-mobile-filter-body {
  display: block;
}

body.admin-shell .voucher-mobile-filter {
  margin-bottom: 12px;
}

body.admin-shell .voucher-mobile-filter > summary {
  display: none;
}

body.admin-shell .voucher-mobile-filter-body {
  display: block;
}

body.admin-shell .wecom-config-summary-card {
  grid-column: 1 / -1;
}

body.admin-shell .wecom-config-panel {
  grid-column: 1 / -1;
}

body.admin-shell .wecom-config-actions,
body.admin-shell .wecom-inline-sync-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-shell .wecom-config-actions .btn,
body.admin-shell .wecom-inline-sync-form .btn {
  min-height: 40px;
}

body.admin-shell .wecom-basic-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.admin-shell .wecom-baota-checklist {
  grid-column: 1 / -1;
}

body.admin-shell.page-users .role-template-panel {
  border-color: #c7d7fe;
  background: #f7faff;
}

body.admin-shell .form-control,
body.admin-shell .form-select {
  min-height: 38px;
}

body.admin-shell .modal .btn-close {
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px auto;
  padding: 14px;
  border-radius: 8px;
}

@media (max-width: 720px) {
  body.admin-shell .modal-backdrop {
    --bs-backdrop-opacity: 0.58;
  }

  body.admin-shell .app-frame {
    display: block;
  }

  body.admin-shell .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: 62px;
    min-height: 62px;
    max-height: 62px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid #1f2937;
  }

  body.admin-shell .brand-block {
    width: auto;
    min-height: 44px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
  }

  body.admin-shell .brand-icon {
    width: 38px;
    height: 38px;
  }

  body.admin-shell .brand-block span:last-child,
  body.admin-shell .nav-section-title,
  body.admin-shell .sidebar-note {
    display: none;
  }

  body.admin-shell .nav-section,
  body.admin-shell .nav-section + .nav-section {
    width: auto;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.admin-shell .app-sidebar .nav-link,
  body.admin-shell .btn,
  body.admin-shell .btn-sm,
  body.admin-shell .form-control,
  body.admin-shell .form-select,
  body.admin-shell .row-actions-more summary,
  body.admin-shell .wecom-mode-tabs a {
    min-height: 44px;
  }

  body.admin-shell .app-sidebar .nav-link {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 12px;
  }

  body.admin-shell .app-main {
    padding: 14px 12px 24px;
  }

  body.admin-shell .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .header-actions .admin-chip:not(.live-status-chip) {
    grid-column: 1 / -1;
  }

  body.admin-shell .filter-toolbar {
    grid-template-columns: 1fr;
  }

  body.admin-shell .search-field {
    grid-column: auto;
  }

  body.admin-shell .mobile-filter-shell,
  body.admin-shell.page-customers .customer-mobile-filter {
    border: 1px solid #dbe7f0;
    border-radius: var(--app-radius);
    background: #f8fafc;
  }

  body.admin-shell .mobile-filter-shell > summary,
  body.admin-shell.page-customers .customer-mobile-filter > summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    color: #334155;
    cursor: pointer;
    font-weight: 850;
    list-style: none;
  }

  body.admin-shell .mobile-filter-shell > summary::-webkit-details-marker,
  body.admin-shell.page-customers .customer-mobile-filter > summary::-webkit-details-marker {
    display: none;
  }

  body.admin-shell .mobile-filter-shell > summary span,
  body.admin-shell.page-customers .customer-mobile-filter > summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  body.admin-shell .mobile-filter-shell > summary em,
  body.admin-shell.page-customers .customer-mobile-filter > summary em {
    color: var(--app-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
  }

  body.admin-shell .mobile-filter-shell[open] > summary,
  body.admin-shell.page-customers .customer-mobile-filter[open] > summary {
    border-bottom: 1px solid #e5edf5;
  }

  body.admin-shell .mobile-filter-shell-body,
  body.admin-shell.page-customers .customer-mobile-filter-body {
    padding: 10px;
  }

  body.admin-shell .mobile-filter-shell .filter-toolbar,
  body.admin-shell.page-customers .customer-mobile-filter .filter-toolbar {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter {
    border: 1px solid #dbe7f0;
    border-radius: var(--app-radius);
    background: #f8fafc;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter > summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    color: #334155;
    cursor: pointer;
    font-weight: 850;
    list-style: none;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter > summary::-webkit-details-marker {
    display: none;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter > summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter > summary em {
    color: var(--app-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter[open] > summary {
    border-bottom: 1px solid #e5edf5;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter-body {
    padding: 10px;
  }

  body.admin-shell.page-vouchers .voucher-mobile-filter .filter-toolbar {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.admin-shell .filter-advanced-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .secondary-section > summary {
    min-height: 44px;
    align-items: flex-start;
  }

  body.admin-shell .dashboard-priority-panel .panel-title {
    gap: 10px;
  }

  body.admin-shell .dashboard-priority-panel .panel-title .d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px !important;
  }

  body.admin-shell .dashboard-priority-panel .panel-title .btn {
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
  }

  body.admin-shell .dashboard-priority-panel .workflow-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-shell .dashboard-priority-panel .workflow-task-card {
    min-height: 104px;
    padding: 12px;
  }

  body.admin-shell .dashboard-priority-panel .workflow-task-card strong {
    font-size: 24px;
  }

  body.admin-shell .dashboard-finance-details .secondary-section-body {
    margin-top: 10px;
  }

  body.admin-shell .payroll-action-panel {
    gap: 12px;
  }

  body.admin-shell .payroll-process-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .payroll-process-strip span {
    min-height: 44px;
    padding: 9px;
    font-size: 12px;
  }

  body.admin-shell .payroll-action-panel .quick-customer-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell .wecom-config-actions,
  body.admin-shell .wecom-inline-sync-form,
  body.admin-shell .wecom-basic-config-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.admin-shell .wecom-config-actions .btn,
  body.admin-shell .wecom-inline-sync-form .btn {
    width: 100%;
  }

  body.admin-shell .modal-dialog {
    max-width: calc(100vw - 16px);
    margin: 8px auto;
  }

  body.admin-shell .modal-content {
    max-height: calc(100vh - 16px);
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.32);
  }

  body.admin-shell .modal-header,
  body.admin-shell .modal-footer {
    padding: 12px;
    background: #ffffff;
  }

  body.admin-shell .modal-header .btn-close {
    flex: 0 0 44px;
  }

  body.admin-shell .modal-body {
    padding: 12px;
    background: #ffffff;
  }

  body.admin-shell .modal .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell .performance-core-field {
    padding: 10px;
  }

  body.admin-shell .performance-payment-field {
    padding: 10px;
  }

  body.admin-shell .upload-owner-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell .modal-secondary-section > summary {
    min-height: 44px;
    padding: 10px 12px;
  }

  body.admin-shell .modal-secondary-section > summary em {
    font-size: 11px;
  }

  body.admin-shell .modal-secondary-section > .form-note {
    margin: 10px 12px 0;
  }

  body.admin-shell .modal-secondary-grid {
    padding: 10px 12px 12px;
  }

  body.admin-shell .tier-card-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell .tier-edit-card {
    padding: 10px;
  }

  body.admin-shell .tier-card-heading {
    align-items: flex-start;
  }

  body.admin-shell .tier-card-fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-shell .performance-customer-summary,
  body.admin-shell .performance-customer-summary dl {
    grid-template-columns: 1fr;
  }

  body.admin-shell .quick-order-form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  body.admin-shell .quick-order-form .form-select[name="order_type_value"],
  body.admin-shell .quick-order-form .form-select[name="order_employee_id"],
  body.admin-shell .quick-order-form .btn {
    width: 100%;
    min-width: 0;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell::before {
    margin-bottom: -2px;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell .btn,
  body.admin-shell .data-table.responsive-card-table td.actions-cell form,
  body.admin-shell .data-table.responsive-card-table td.actions-cell .row-actions-more,
  body.admin-shell .row-actions-more > div .btn,
  body.admin-shell .row-actions-more > div form {
    width: 100%;
  }

  body.admin-shell .data-table.responsive-card-table tbody tr {
    height: auto !important;
    overflow: visible;
  }

  body.admin-shell .data-table.responsive-card-table td {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible;
    line-height: 1.5;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell > * {
    position: static !important;
    width: 100%;
  }

  body.admin-shell .data-table.responsive-card-table td.actions-cell .btn,
  body.admin-shell .data-table.responsive-card-table td.actions-cell button,
  body.admin-shell .data-table.responsive-card-table td.actions-cell select {
    min-height: 44px;
  }

  body.admin-shell .data-table.responsive-card-table td.customer-row-actions {
    gap: 10px;
  }

  body.admin-shell .customer-action-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-shell .customer-action-common {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .customer-action-common .quick-order-form {
    grid-column: 1 / -1;
  }

  body.admin-shell .customer-action-common .btn {
    width: 100%;
    min-width: 0;
  }

  body.admin-shell .customer-action-next .btn {
    width: 100%;
  }

  body.admin-shell .customer-detail-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  body.admin-shell .customer-detail-actions .btn,
  body.admin-shell .customer-detail-actions .upload-direct-form {
    width: 100%;
  }

  body.admin-shell .customer-detail-actions .btn {
    min-height: 44px;
  }

  body.admin-shell .customer-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .customer-detail-columns {
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-detail-sections {
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-profile-list dl > div {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  body.admin-shell .customer-timeline article {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  body.admin-shell .customer-timeline time {
    grid-column: 2;
  }

  body.admin-shell .wecom-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .wecom-mode-tabs a {
    justify-content: center;
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
  }

  body.admin-shell.page-customers .customer-next-step {
    width: 100%;
    max-width: none;
    margin-top: 10px;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td:not(.actions-cell) {
    display: block;
    height: auto !important;
    min-height: 0 !important;
    padding: 9px 0;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td:not(.actions-cell)::before {
    display: block;
    margin-bottom: 4px;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table tbody tr {
    display: flex;
    flex-direction: column;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td:first-child {
    order: 1;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td:not(:first-child):not(.actions-cell) {
    order: 3;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="获客参数"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="咨询需求"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="服务/转交"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="公司员工分工"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="收入/成本"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="ROI"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="开口"],
  body.admin-shell.page-customers .data-table.responsive-card-table td[data-label="预约/添加"],
  body.admin-shell.page-customers .customer-compact-table td[data-label="服务状态"],
  body.admin-shell.page-customers .customer-compact-table td[data-label="时间"] {
    display: none !important;
  }

  body.admin-shell.page-customers .data-table.responsive-card-table td.actions-cell {
    order: 2;
    gap: 10px;
    margin: 8px 0 10px;
    padding: 10px;
    border: 1px solid #dbe7f0;
    border-radius: var(--app-radius);
    background: #f8fafc;
  }

  body.admin-shell .row-actions-more > div {
    width: 100%;
  }

  body.admin-shell.page-customers .customer-action-more > summary {
    width: 100%;
    min-height: 38px;
    border-color: #dbe7f0;
    background: #ffffff;
    color: #64748b;
  }

  body.admin-shell.page-customers .customer-action-more > div {
    margin-top: 8px;
  }

  body.admin-shell .attachment-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell .attachment-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  body.admin-shell .attachment-preview {
    width: 76px;
  }

  body.admin-shell .attachment-heading {
    display: grid;
    gap: 4px;
    justify-content: stretch;
  }

  body.admin-shell .attachment-heading span {
    justify-self: start;
  }

  body.admin-shell .attachment-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-shell .attachment-actions .btn,
  body.admin-shell .attachment-actions form {
    width: 100%;
  }

  body.admin-shell.page-roi .roi-customer-table td[data-label="需求/套餐"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="服务/转交"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="公司员工分工"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="开单人"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="收入来源"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="广告成本"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="总成本"],
  body.admin-shell.page-roi .roi-customer-table td[data-label="备注"],
  body.admin-shell.page-roi .roi-ad-spend-table td[data-label="渠道"],
  body.admin-shell.page-roi .roi-ad-spend-table td[data-label="获客链接"],
  body.admin-shell.page-roi .roi-ad-spend-table td[data-label="点击"],
  body.admin-shell.page-roi .roi-ad-spend-table td[data-label="备注"] {
    display: none !important;
  }

  body.admin-shell.page-roi .roi-customer-table tbody tr,
  body.admin-shell.page-roi .roi-ad-spend-table tbody tr {
    gap: 2px;
  }

  body.admin-shell.page-roi .roi-attribution-queue .panel-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell.page-roi .roi-attribution-queue .panel-title .d-flex,
  body.admin-shell.page-roi .roi-attribution-queue .panel-title .btn {
    width: 100%;
  }

  body.admin-shell.page-roi .roi-attribution-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-roi .roi-attribution-card-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.admin-shell.page-roi .roi-attribution-card-head > span {
    justify-self: start;
  }

  body.admin-shell.page-roi .roi-attribution-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-roi .roi-attribution-card dl > div:nth-child(4) {
    grid-column: 1 / -1;
  }

  body.admin-shell.page-roi .roi-attribution-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-roi .roi-attribution-actions .btn {
    width: 100%;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 13px;
    font-weight: 850;
  }

  body.admin-shell.page-transactions .transactions-ledger-table td[data-label="往来对象"],
  body.admin-shell.page-transactions .transactions-ledger-table td[data-label="项目"],
  body.admin-shell.page-transactions .transactions-ledger-table td[data-label="客户/员工"],
  body.admin-shell.page-transactions .transactions-ledger-table td[data-label="广告归因"],
  body.admin-shell.page-expenses .transactions-ledger-table td[data-label="往来对象"],
  body.admin-shell.page-expenses .transactions-ledger-table td[data-label="项目"],
  body.admin-shell.page-expenses .transactions-ledger-table td[data-label="客户/员工"],
  body.admin-shell.page-expenses .transactions-ledger-table td[data-label="广告归因"] {
    display: none !important;
  }

  body.admin-shell.page-transactions .transactions-ledger-table tbody tr,
  body.admin-shell.page-expenses .transactions-ledger-table tbody tr {
    gap: 2px;
  }

  body.admin-shell.page-employees .employee-roster-table td[data-label="上级/地点"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="底薪"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="提成"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="企微绑定"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="客户/成交"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="服务客户"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="经营利润"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="归因"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="资产"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="累计业绩"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="累计实发"],
  body.admin-shell.page-employees .employee-roster-table td[data-label="入离职"] {
    display: none !important;
  }

  body.admin-shell.page-employees .employee-roster-table tbody tr {
    gap: 2px;
  }

  body.admin-shell.page-employees .employee-detail-head,
  body.admin-shell.page-employees .employee-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.admin-shell.page-employees .employee-detail-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  body.admin-shell.page-employees .employee-detail-score,
  body.admin-shell.page-employees .employee-detail-grid,
  body.admin-shell.page-employees .employee-detail-lists {
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-employees .employee-detail-grid dl > div {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 9px 10px;
  }

  body.admin-shell.page-employees .employee-detail-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-shell.page-employees .employee-detail-links .btn {
    width: 100%;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 13px;
    font-weight: 850;
  }

  body.admin-shell.page-settlement .settlement-ledger-table td[data-label="往来对象"],
  body.admin-shell.page-settlement .settlement-ledger-table td[data-label="项目/分类"],
  body.admin-shell.page-settlement .settlement-ledger-table td[data-label="入账"],
  body.admin-shell.page-settlement .settlement-ledger-table td[data-label="凭证"] {
    display: none !important;
  }

  body.admin-shell.page-settlement .settlement-ledger-table tbody tr {
    gap: 2px;
  }

  body.admin-shell.page-assets .asset-register-table td[data-label="编号"],
  body.admin-shell.page-assets .asset-register-table td[data-label="购入日期"],
  body.admin-shell.page-assets .asset-register-table td[data-label="原值"],
  body.admin-shell.page-assets .asset-register-table td[data-label="凭证"] {
    display: none !important;
  }

  body.admin-shell.page-assets .asset-register-table tbody tr {
    gap: 2px;
  }

  body.admin-shell.page-users .users-account-table td[data-label="显示名称"],
  body.admin-shell.page-users .users-account-table td[data-label="绑定员工"],
  body.admin-shell.page-users .users-account-table td[data-label="企微侧边栏"],
  body.admin-shell.page-users .users-account-table td[data-label="数据范围"],
  body.admin-shell.page-users .users-account-table td[data-label="权限预览"],
  body.admin-shell.page-users .users-account-table td[data-label="最后登录"],
  body.admin-shell.page-users .users-account-table td[data-label="备注"] {
    display: none !important;
  }

  body.admin-shell.page-users .users-account-table tbody tr {
    gap: 2px;
  }
}

@media (max-width: 720px) {
  body.admin-shell.simple-role-shell .main-header {
    gap: 10px;
  }

  body.admin-shell.simple-role-shell .page-heading small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-shell.simple-role-shell .header-actions {
    grid-template-columns: minmax(96px, 1.35fr) repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-shell.simple-role-shell .header-actions .admin-chip:not(.live-status-chip) {
    display: none;
  }

  body.admin-shell.simple-role-shell .header-actions > .live-status-chip,
  body.admin-shell.simple-role-shell .header-actions > .icon-text-btn,
  body.admin-shell.simple-role-shell .header-actions > button[data-bs-target="#passwordModal"],
  body.admin-shell.simple-role-shell .header-actions > form {
    width: 100%;
    min-height: 40px;
  }

  body.admin-shell.simple-role-shell .header-actions > .live-status-chip,
  body.admin-shell.simple-role-shell .header-actions > .icon-text-btn {
    grid-column: auto;
  }

  body.admin-shell.simple-role-shell .header-actions > button[data-bs-target="#passwordModal"],
  body.admin-shell.simple-role-shell .header-actions > form .btn {
    min-height: 40px;
  }
}

@media (max-width: 420px) {
  body.admin-shell.simple-role-shell .header-actions .btn,
  body.admin-shell.simple-role-shell .header-actions .admin-chip {
    padding-inline: 8px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  body.admin-shell.simple-role-shell {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.admin-shell.simple-role-shell .app-frame {
    display: block;
  }

  body.admin-shell.simple-role-shell .app-sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1040;
    width: 100%;
    height: auto;
    min-height: 68px;
    max-height: none;
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    overflow: visible;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    border-right: 0;
    border-bottom: 0;
    background: #0f172a;
    box-shadow: 0 -14px 30px rgba(15, 23, 42, 0.16);
  }

  body.admin-shell.simple-role-shell .brand-block,
  body.admin-shell.simple-role-shell .nav-section-title,
  body.admin-shell.simple-role-shell .sidebar-note {
    display: none !important;
  }

  body.admin-shell.simple-role-shell .nav-section,
  body.admin-shell.simple-role-shell .nav-section + .nav-section {
    display: contents;
    margin: 0;
    padding: 0;
    border: 0;
  }

  body.admin-shell.simple-role-shell .app-sidebar .nav-link {
    min-width: 0;
    min-height: 56px;
    flex: 1 1 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    margin: 0;
    padding: 5px 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
  }

  body.admin-shell.simple-role-shell .app-sidebar .nav-link i {
    width: auto;
    font-size: 17px;
    line-height: 1;
  }

  body.admin-shell.simple-role-shell .app-sidebar .nav-link span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.admin-shell.simple-role-shell .app-sidebar .nav-link:hover,
  body.admin-shell.simple-role-shell .app-sidebar .nav-link.active {
    border-color: rgba(250, 204, 21, 0.75);
    background: rgba(30, 41, 59, 0.92);
    color: #ffffff;
    box-shadow: none;
  }

  body.admin-shell.simple-role-shell .app-main {
    padding-bottom: calc(124px + env(safe-area-inset-bottom));
  }
}

/* Operational mobile polish: keep the work surface short, scannable, and thumb-friendly. */
body.admin-shell {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

@media (max-width: 720px) {
  body.admin-shell .main-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #dbe7f0;
    background: #f8fafc;
  }

  body.admin-shell .page-heading {
    display: grid;
    gap: 2px;
  }

  body.admin-shell .page-kicker {
    font-size: 12px;
  }

  body.admin-shell .page-heading h1 {
    margin-top: 0;
    font-size: 26px;
    line-height: 1.15;
  }

  body.admin-shell .page-heading small {
    color: #647386;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  body.admin-shell .header-actions {
    display: grid !important;
    grid-template-columns: minmax(96px, 1.35fr) repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  body.admin-shell .header-actions .admin-chip:not(.live-status-chip) {
    display: none;
  }

  body.admin-shell .header-actions > .live-status-chip,
  body.admin-shell .header-actions > .icon-text-btn,
  body.admin-shell .header-actions > button[data-bs-target="#passwordModal"],
  body.admin-shell .header-actions > form {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  body.admin-shell .header-actions > form {
    display: block;
  }

  body.admin-shell .header-actions > form .btn {
    width: 100%;
    min-height: 42px;
  }

  body.admin-shell .header-actions .btn,
  body.admin-shell .header-actions .admin-chip {
    justify-content: center;
    padding-inline: 8px;
    font-size: 12px;
    font-weight: 850;
  }

  body.admin-shell .period-form {
    grid-column: 1 / -1;
  }

  body.admin-shell.page-customers .panel-title > .d-flex {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px !important;
  }

  body.admin-shell.page-customers .panel-title > .d-flex .btn {
    width: 100%;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
    font-weight: 850;
    white-space: normal;
  }

  body.admin-shell.page-customers .panel-title > .d-flex .btn-primary {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  body.admin-shell.page-customers .customer-mode-switch {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.admin-shell.page-customers .customer-mode-switch a {
    min-height: 66px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  body.admin-shell.page-customers .customer-mode-switch i {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  body.admin-shell.page-customers .customer-flow-panel .panel-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell.page-customers .customer-title-actions {
    width: 100%;
    justify-items: stretch;
  }

  body.admin-shell.page-customers .customer-stage-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
  }

  body.admin-shell.page-customers .service-stage-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-customers .customer-stage-tab {
    min-width: 0;
    min-height: 38px;
    justify-content: center;
    gap: 4px;
    padding: 0 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  body.admin-shell.page-customers .customer-stage-tab em {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 11px;
  }

  body.admin-shell.page-customers .customer-title-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  body.admin-shell.page-customers .customer-title-buttons .btn {
    width: 100%;
    min-height: 42px;
    padding-inline: 8px;
    font-size: 13px;
    font-weight: 850;
  }

  body.admin-shell.page-customers .customer-title-buttons .btn-primary {
    grid-column: 1 / -1;
  }

  body.admin-shell.page-customers .customer-flow-note {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 9px 10px;
  }

  body.admin-shell.page-customers .customer-flow-note i {
    width: 30px;
    height: 30px;
  }

  body.admin-shell.page-customers .customer-mobile-filter:not([open]) {
    background: #ffffff;
  }

  body.admin-shell.page-customers .customer-mobile-filter:not([open]) > summary {
    border-bottom: 0;
  }

  body.admin-shell.page-customers .customer-mobile-filter[open] {
    box-shadow: var(--app-shadow-sm);
  }

  body.admin-shell.page-customers .customer-action-next .btn {
    min-height: 46px;
    font-size: 14px;
  }

  body.admin-shell.page-customers .customer-action-common {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-customers .customer-action-common .btn {
    min-height: 44px;
  }

  body.admin-shell.page-customers .service-delivery-panel .panel-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-shell.page-customers .service-delivery-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-customers .service-delivery-metrics .metric-card:last-child {
    grid-column: 1 / -1;
  }

  body.admin-shell.page-customers .service-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-customers .service-card-state {
    min-width: 0;
    justify-items: start;
  }

  body.admin-shell.page-customers .service-card-state .customer-next-step {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  body.admin-shell.page-customers .service-card-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell.page-customers .service-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.admin-shell.page-customers .service-card-actions .btn,
  body.admin-shell.page-customers .service-card-actions form,
  body.admin-shell.page-customers .service-card-actions form .btn,
  body.admin-shell.page-customers .service-card-actions details,
  body.admin-shell.page-customers .service-card-more > summary {
    width: 100%;
    min-height: 44px;
  }

  body.admin-shell.page-customers .service-card-actions form:first-child,
  body.admin-shell.page-customers .service-card-actions form:first-child .btn {
    grid-column: 1 / -1;
  }

  body.admin-shell.page-customers .service-card-more > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-approval .approval-header-actions,
  body.admin-shell.page-approval .approval-header-actions .btn {
    width: 100%;
  }

  body.admin-shell.page-approval .approval-kpi-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-approval .reimbursement-card-strip,
  body.admin-shell.page-approval .reimbursement-account-chip,
  body.admin-shell.page-approval .reimbursement-proof-status {
    width: 100%;
  }

  body.admin-shell.page-approval .reimbursement-entry-grid {
    grid-template-columns: 1fr;
  }

  body.admin-shell.page-vouchers .voucher-customer-card dl > div:nth-child(n+3) {
    display: none;
  }

  body.admin-shell.page-vouchers .voucher-quick-note {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 9px 10px;
  }

  body.admin-shell.page-vouchers .voucher-quick-note i {
    width: 30px;
    height: 30px;
  }

  body.admin-shell.simple-role-shell.page-payroll .payroll-frontline-panel .panel-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
  }

  body.admin-shell.simple-role-shell.page-payroll .payroll-frontline-panel .panel-title .btn {
    width: auto;
    min-width: 112px;
    min-height: 42px;
    padding-inline: 12px;
  }

  body.admin-shell.simple-role-shell.page-payroll .quick-flow-note-compact {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 9px 10px;
  }

  body.admin-shell.simple-role-shell.page-payroll .quick-flow-note-compact i {
    width: 30px;
    height: 30px;
  }

  body.admin-shell.simple-role-shell.page-payroll .quick-flow-note-compact strong {
    font-size: 14px;
  }

  body.admin-shell.simple-role-shell.page-payroll .quick-flow-note-compact span {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  body.admin-shell .report-brief-grid,
  body.admin-shell .profit-brief-grid,
  body.admin-shell .deployment-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-shell .report-brief-grid .brief-metric:last-child,
  body.admin-shell .profit-brief-grid .brief-metric:last-child {
    grid-column: 1 / -1;
  }

  body.admin-shell .brief-metric {
    min-height: 86px;
    padding: 10px;
  }

  body.admin-shell .brief-metric strong {
    font-size: 19px;
  }

  body.admin-shell .report-status-strip {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 10px;
  }

  body.admin-shell .report-status-strip i {
    width: 32px;
    height: 32px;
  }

  body.admin-shell.page-customers .panel-title > .d-flex {
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-detail-actions,
  body.admin-shell .customer-detail-grid,
  body.admin-shell .customer-detail-definition,
  body.admin-shell .customer-detail-sections,
  body.admin-shell .wecom-mode-tabs {
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-profile-list dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  body.admin-shell .customer-detail-section {
    padding: 10px;
  }

  body.admin-shell .customer-detail-mini-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.admin-shell .customer-detail-mini-actions .btn,
  body.admin-shell .customer-detail-mini-actions form,
  body.admin-shell .customer-detail-mini-actions form .btn {
    width: 100%;
  }

  body.admin-shell .customer-detail-safe-note {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  body.admin-shell .header-actions {
    gap: 7px;
  }

  body.admin-shell .header-actions .btn,
  body.admin-shell .header-actions .admin-chip {
    min-height: 40px;
    font-size: 12px;
  }
}
