/* 工单管理（个人工单） */

.work-order-mgmt-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.work-order-mgmt-page-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.work-order-mgmt-page-header p {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.work-order-mgmt-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.wo-mgmt-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.wo-mgmt-tab {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.wo-mgmt-tab:hover {
  color: var(--color-text);
}

.wo-mgmt-tab.is-active {
  color: var(--color-primary);
  font-weight: 500;
  border-bottom-color: var(--color-primary);
}

.wo-mgmt-tab-count {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.wo-mgmt-tab.is-active .wo-mgmt-tab-count {
  color: var(--color-primary);
}

.work-order-mgmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}

.wo-mgmt-list-card .wo-mgmt-tabs {
  border-top: none;
}

.work-order-mgmt-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-order-mgmt-filter {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-end;
}

.work-order-mgmt-filter label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.work-order-mgmt-filter select,
.work-order-mgmt-filter input[type="date"] {
  min-width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
}

.work-order-mgmt-filter-dates {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-order-mgmt-filter-dates span {
  font-size: 12px;
  color: var(--color-text-muted);
  padding-bottom: 8px;
}

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

.work-order-mgmt-table-wrap {
  overflow-x: auto;
}

.wo-mgmt-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-secondary);
  background: #fff;
}

.wo-mgmt-pagination-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wo-mgmt-page-nums {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wo-mgmt-page-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.wo-mgmt-page-num.is-active {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.wo-mgmt-page-num:hover:not(.is-active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.wo-mgmt-page-ellipsis {
  padding: 0 4px;
  color: var(--color-text-muted);
}

.wo-mgmt-page-size select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
}

.work-order-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.work-order-mgmt-table thead {
  background: #f8fafc;
}

.work-order-mgmt-table th,
.work-order-mgmt-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

.work-order-mgmt-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.wo-col-check {
  width: 44px;
  text-align: center;
}

.wo-mgmt-check-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  margin: 0;
  cursor: pointer;
}

.wo-mgmt-check-label--head {
  vertical-align: middle;
}

.wo-mgmt-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-primary, #2563eb);
}

.wo-col-title {
  min-width: 180px;
  max-width: 320px;
}

.wo-title-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wo-title-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wo-subscribe-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.wo-priority-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.wo-priority-tag--urgent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.wo-priority-tag--high {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.wo-col-priority {
  min-width: 88px;
}

.wo-col-actions {
  min-width: 160px;
  white-space: nowrap;
}

.wo-col-due {
  min-width: 150px;
  white-space: nowrap;
}

.wo-col-due.is-overdue {
  color: #dc2626;
  font-weight: 500;
}

.wo-overdue-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
}

.work-order-mgmt-row:hover {
  background: #f8fafc;
}

.work-order-mgmt-row.is-unread {
  background: #f0f7ff;
}

.work-order-mgmt-row.is-unread:hover {
  background: #e8f2ff;
}

.work-order-mgmt-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.work-order-mgmt-status--pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.work-order-mgmt-status--processing {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.work-order-mgmt-status--review {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.work-order-mgmt-status--done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.wo-mgmt-title-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--color-text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.wo-mgmt-title-link:hover {
  color: var(--color-primary, #2563eb);
}

.wo-mgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wo-mgmt-action {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.wo-mgmt-action:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.wo-mgmt-action--primary {
  color: var(--color-primary, #2563eb);
  border-color: #93c5fd;
  background: #eff6ff;
}

.wo-mgmt-action--primary:hover {
  background: #dbeafe;
}

.wo-mgmt-action--warn {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.wo-mgmt-action--warn:hover {
  background: #fee2e2;
}

.wo-mgmt-action--subscribed {
  color: #2563eb;
  border-color: #93c5fd;
  background: #eff6ff;
}

.wo-mgmt-action--subscribed:hover {
  background: #dbeafe;
}

.wo-mgmt-actions {
  max-width: 200px;
}

.wo-mgmt-priority-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.wo-mgmt-action-empty {
  color: var(--color-text-muted);
}

.work-order-mgmt-empty {
  padding: 48px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
}

.work-order-mgmt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  z-index: 9999;
  pointer-events: none;
}

.work-order-mgmt-toast[hidden] {
  display: none !important;
}

/* 评价弹窗 */
.work-order-mgmt-modal[hidden] {
  display: none !important;
}

.work-order-mgmt-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.work-order-mgmt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.work-order-mgmt-modal-dialog {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.work-order-mgmt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.work-order-mgmt-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.work-order-mgmt-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}

.work-order-mgmt-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wo-mgmt-rate-ticket {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
}

.wo-mgmt-rate-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0;
}

.wo-mgmt-rate-fieldset legend {
  font-size: 13px;
  font-weight: 500;
  padding: 0 4px;
}

.wo-mgmt-rate-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.wo-mgmt-rate-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.wo-mgmt-rate-comment-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.wo-mgmt-rate-comment-label textarea {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
}

.work-order-mgmt-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
}

.wo-mgmt-supplement-dialog {
  max-width: 520px;
}

.wo-mgmt-supplement-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.wo-mgmt-supplement-upload input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
}

.wo-mgmt-supplement-file-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.wo-mgmt-supplement-file-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.wo-mgmt-supplement-file-list .wo-mgmt-supplement-file-remove {
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 12px;
  cursor: pointer;
}

.wo-mgmt-supplement-file-list .wo-mgmt-supplement-file-remove:hover {
  text-decoration: underline;
}

.wo-mgmt-timeline-attachments {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.wo-mgmt-timeline-attachments li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.wo-mgmt-timeline-attachments .wo-mgmt-attach-icon {
  width: 28px;
  height: 28px;
  font-size: 9px;
}

/* 列表 / 详情切换 */
.wo-mgmt-list-view[hidden],
.wo-mgmt-detail-view[hidden] {
  display: none !important;
}

.work-order-mgmt-page.is-detail-view .work-order-mgmt-page-header {
  display: none;
}

.wo-mgmt-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wo-mgmt-detail-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wo-mgmt-detail-card {
  padding: 0;
}

.wo-mgmt-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.wo-mgmt-detail-header-main h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.wo-mgmt-detail-id {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.wo-mgmt-detail-priority {
  flex-shrink: 0;
  align-self: flex-start;
}

.wo-mgmt-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: #fafbfc;
}

.wo-mgmt-detail-meta div {
  min-width: 0;
}

.wo-mgmt-detail-meta dt {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.wo-mgmt-detail-meta dd {
  font-size: 13px;
  color: var(--color-text);
  margin: 0;
  font-weight: 500;
}

.wo-mgmt-detail-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.wo-mgmt-detail-section:last-child {
  border-bottom: none;
}

.wo-mgmt-detail-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
}

.wo-mgmt-rich-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.wo-mgmt-rich-content p {
  margin: 0 0 10px;
}

.wo-mgmt-rich-content p:last-child {
  margin-bottom: 0;
}

.wo-mgmt-rich-content ul,
.wo-mgmt-rich-content ol {
  margin: 0 0 10px 1.2em;
  padding: 0;
}

.wo-mgmt-rich-content li {
  margin-bottom: 4px;
}

.wo-mgmt-rich-content blockquote {
  margin: 10px 0;
  padding: 10px 14px;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.wo-mgmt-rich-content code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  font-size: 12px;
}

.wo-mgmt-rich-content mark {
  background: #fef3c7;
  padding: 0 2px;
}

.wo-mgmt-rich-content strong {
  color: var(--color-text);
  font-weight: 600;
}

.wo-mgmt-media {
  margin: 12px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}

.wo-mgmt-media img,
.wo-mgmt-media video {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #e2e8f0;
}

.wo-mgmt-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.wo-mgmt-media figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: #f8fafc;
  border-top: 1px solid var(--color-border);
}

.wo-mgmt-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wo-mgmt-attach-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.wo-mgmt-attach-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.wo-mgmt-attach-icon--pdf { background: #dc2626; }
.wo-mgmt-attach-icon--doc { background: #2563eb; }
.wo-mgmt-attach-icon--xls { background: #16a34a; }
.wo-mgmt-attach-icon--csv { background: #0891b2; }
.wo-mgmt-attach-icon--txt { background: #64748b; }
.wo-mgmt-attach-icon--file { background: #64748b; }

.wo-mgmt-attach-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wo-mgmt-attach-info strong {
  font-size: 13px;
  color: var(--color-text);
}

.wo-mgmt-attach-info span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.wo-mgmt-attach-dl {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-primary, #2563eb);
}

.wo-mgmt-attach-dl:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

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

/* 处理历史时间线 */
.wo-mgmt-timeline {
  position: relative;
  padding-left: 20px;
}

.wo-mgmt-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}

.wo-mgmt-timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.wo-mgmt-timeline-item:last-child {
  padding-bottom: 0;
}

.wo-mgmt-timeline-dot {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #94a3b8;
  box-sizing: border-box;
}

.wo-mgmt-timeline-item--submit .wo-mgmt-timeline-dot { border-color: #2563eb; background: #dbeafe; }
.wo-mgmt-timeline-item--system .wo-mgmt-timeline-dot { border-color: #64748b; }
.wo-mgmt-timeline-item--assign .wo-mgmt-timeline-dot { border-color: #7c3aed; background: #ede9fe; }
.wo-mgmt-timeline-item--process .wo-mgmt-timeline-dot { border-color: #0891b2; background: #cffafe; }
.wo-mgmt-timeline-item--opinion .wo-mgmt-timeline-dot { border-color: #d97706; background: #fef3c7; }
.wo-mgmt-timeline-item--done .wo-mgmt-timeline-dot { border-color: #16a34a; background: #dcfce7; }
.wo-mgmt-timeline-item--urge .wo-mgmt-timeline-dot { border-color: #dc2626; background: #fee2e2; }
.wo-mgmt-timeline-item--rate .wo-mgmt-timeline-dot { border-color: #9333ea; background: #f3e8ff; }
.wo-mgmt-timeline-item--finish .wo-mgmt-timeline-dot { border-color: #15803d; background: #bbf7d0; }
.wo-mgmt-timeline-item--append .wo-mgmt-timeline-dot { border-color: #0284c7; background: #e0f2fe; }

.wo-mgmt-timeline-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  background: #fff;
}

.wo-mgmt-timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.wo-mgmt-timeline-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.wo-mgmt-timeline-time {
  font-size: 12px;
  color: var(--color-text-muted);
}

.wo-mgmt-timeline-actor {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0 0 8px;
}

.wo-mgmt-timeline-body {
  font-size: 13px;
}

.wo-mgmt-detail-btn {
  font-size: 13px;
}
