:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #f8759b;
  --border: #e5e7eb;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  background: #f1f1f1;
  padding: 2px 6px;
  border-radius: 6px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.login-card h2 {
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.login-form {
  display: flex;
  gap: 12px;
}

.login-form input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.login-form button {
  background: var(--primary);
  border: 0;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.error {
  margin-top: 12px;
  color: #b91c1c;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 16px;
  height: calc(100vh - 32px);
  box-sizing: border-box;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

.brand {
  font-weight: 900;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 12px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  min-height: 0;
}

nav .nav-group {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

nav .nav-group-title {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

nav .nav-group-title:hover {
  background: #f9fafb;
}

nav .nav-group-title::after {
  content: "▾";
  float: right;
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

nav .nav-group:not(.expanded) .nav-group-title::after {
  content: "▸";
}

nav .nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

nav .nav-group:not(.expanded) .nav-group-items {
  display: none;
}

nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
}

nav .nav-group-items a {
  font-size: 13px;
  padding: 8px 10px;
}

nav a:hover {
  background: #f9fafb;
  border-color: var(--border);
}

.foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.foot a {
  color: var(--muted);
  text-decoration: none;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.topbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.title {
  font-weight: 900;
  font-size: 18px;
}

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

.panel {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.ghost {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.panel-body {
  padding: 16px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

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

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.primary {
  background: var(--primary);
  border: 0;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e3e8f2;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.04);
}

.table th,
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f7;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid #edf1f7;
}

.table th {
  background: linear-gradient(180deg, #f8faff 0%, #f3f6fd 100%);
  color: #334155;
  font-weight: 800;
  border-bottom: 1px solid #dbe3f2;
}

.table tbody tr:nth-child(even) {
  background: #fbfcff;
}

.table tbody tr:hover {
  background: #f3f7ff;
}

.table th:last-child,
.table td:last-child {
  border-right: 0;
}

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

/* 成本管理 · 工资管理：表宽压缩 + 横向滚动，整块在视口内可见 */
.salary-mgmt-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #e3e8f2;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.04);
  -webkit-overflow-scrolling: touch;
}

.salary-mgmt-scroll .salary-mgmt-table {
  width: max-content;
  min-width: min(100%, 920px);
  margin-top: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  table-layout: fixed;
}

.salary-mgmt-scroll .salary-mgmt-table th,
.salary-mgmt-scroll .salary-mgmt-table td {
  padding: 6px 4px;
  font-size: 12px;
  vertical-align: middle;
}

.salary-mgmt-scroll .salary-mgmt-table th {
  line-height: 1.15;
  text-align: center;
}

.salary-mgmt-scroll .salary-th-txt {
  display: block;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 auto;
  text-align: center;
}

.salary-mgmt-scroll .salary-mgmt-table th:nth-child(1) .salary-th-txt,
.salary-mgmt-scroll .salary-mgmt-table th:nth-child(2) .salary-th-txt {
  max-width: 40px;
}

.salary-mgmt-scroll .salary-mgmt-table th:nth-child(15) .salary-th-txt {
  max-width: 36px;
}

.salary-mgmt-scroll .salary-mgmt-table th:nth-child(16) .salary-th-txt {
  max-width: 32px;
}

.salary-mgmt-scroll .salary-td-name {
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.salary-mgmt-scroll .salary-inp {
  box-sizing: border-box;
  width: 100%;
  max-width: 52px;
  padding: 4px 2px;
  font-size: 12px;
  border-radius: 6px;
}

.salary-mgmt-scroll .salary-inp-days {
  max-width: 40px;
}

.salary-mgmt-scroll .salary-inp-money {
  max-width: 50px;
}

.salary-mgmt-scroll .salary-position-name {
  max-width: 48px;
}

.salary-mgmt-scroll .salary-remark {
  max-width: 64px;
}

.salary-mgmt-scroll .salary-row-del {
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.one-line-ellipsis {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.danger {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

/* 报修管理：「标记已维修」「驳回」「删除」上下内边距缩小 1/3，整体高度约降为原来的 2/3 */
button.repair-op-tight.primary {
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.2;
}
button.repair-op-tight.ghost {
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.2;
}
button.repair-op-tight.danger {
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.global-center-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  min-width: 120px;
  max-width: 70vw;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.global-center-toast.show {
  opacity: 1;
}

/* 报表「订单明细」：全屏遮罩 + 大号可滚动弹窗 */
.order-report-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.order-report-detail-dialog {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  max-width: 720px;
  width: 100%;
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}

.order-report-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.order-report-detail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.order-report-detail-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.order-report-detail-section {
  margin-bottom: 20px;
}

.order-report-detail-section:last-child {
  margin-bottom: 0;
}

.order-report-detail-h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.order-report-detail-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
}

.order-report-detail-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: normal;
}

.order-report-detail-dl dd {
  margin: 0;
  word-break: break-all;
}

.order-detail-promo-dd {
  white-space: pre-wrap;
}

.order-detail-item-spec {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.order-report-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.order-report-detail-items {
  margin: 0;
  min-width: 100%;
}

.order-report-detail-items th,
.order-report-detail-items td {
  padding: 10px 12px;
  font-size: 13px;
}

.order-report-detail-close {
  flex-shrink: 0;
}

.order-report-actual-dd,
.od-col-actual {
  font-weight: 700;
}

