/* 供应商页面共享样弁E*/

/* 页头 */
.page-header-supplier {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header-supplier .page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.page-header-supplier .page-desc {
    font-size: 0.8125rem;
    color: #888;
    margin: 0.2rem 0 0;
}

/* 筛选栁E*/
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    flex: 1;
    min-width: 140px;
}

/* 空状态E*/
.empty-card {
    background: #fff;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    color: #999;
}

/* 加载状态E*/
.loading-state {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.875rem;
}

/* ---- 流程�E表 ---- */
.process-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.process-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    padding: 1rem;
    transition: box-shadow .15s, border-color .15s;
    gap: 0.75rem;
}

.process-card:hover {
    box-shadow: 0 2px 12px rgba(37,99,235,.1);
    border-color: #c7d7f7;
}

.process-card-body {
    flex: 1;
    min-width: 0;
}

.process-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-bottom: 0.3rem;
}

.process-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a2e;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.process-desc {
    font-size: 0.8125rem;
    color: #666;
    margin: 0.3rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.process-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.375rem;
}

.process-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 卡牁E��侧按钮绁E*/
.process-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: stretch;
    min-width: 130px;
}

.process-card-actions .btn {
    white-space: nowrap;
    font-size: 0.8125rem;
    text-align: center;
}

@media (max-width: 767px) {
    .process-card {
        flex-direction: column;
        align-items: stretch;
    }

    .process-card-actions {
        flex-direction: column;
        min-width: unset;
        width: 100%;
    }

    .process-card-actions .btn {
        width: 100%;
    }
}

/* ---- 状态徽栁E---- */
.status-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-warning  { background: #fff8e1; color: #e65100; border: 1px solid #ffe082; }
.badge-success  { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.badge-danger   { background: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }
.badge-secondary { background: #f5f5f5; color: #666;   border: 1px solid #e0e0e0; }
.badge-info     { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }

/* ---- 流程详惁E---- */
.detail-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.detail-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.detail-card-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 0.4rem;
}

.detail-text {
    font-size: 0.875rem;
    color: #333;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    min-height: 2.5rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 陁E��列表 */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.attachment-icon {
    flex-shrink: 0;
    color: #2563eb;
}

.attachment-name {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #333;
    word-break: break-all;
}

.attachment-date {
    font-size: 0.72rem;
    color: #aaa;
}

/* 审批厁E�� */
.history-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e8e8e8;
}

.history-item {
    position: relative;
    margin-bottom: 1rem;
}

.history-item::before {
    content: '';
    position: absolute;
    left: -1.1rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #2563eb;
}

.history-item.rejected::before { background: #dc3545; box-shadow: 0 0 0 2px #dc3545; }
.history-item.approved::before { background: #198754; box-shadow: 0 0 0 2px #198754; }
.history-item.auto_approved::before { background: #0d47a1; box-shadow: 0 0 0 2px #0d47a1; }
.history-item.updated::before { background: #6d28d9; box-shadow: 0 0 0 2px #6d28d9; }

.history-op {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #333;
}

.history-meta {
    font-size: 0.72rem;
    color: #aaa;
    margin-top: 0.125rem;
}

.history-reason {
    font-size: 0.8rem;
    color: #dc3545;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.375rem;
}

.history-reason-approve {
    font-size: 0.8rem;
    color: #198754;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.375rem;
}

.history-reason-auto {
    font-size: 0.8rem;
    color: #0d47a1;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.375rem;
}

.history-reason-update {
    font-size: 0.8rem;
    color: #6d28d9;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.375rem;
}

/* ---- 表单通用 ---- */
.form-section {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

/* 斁E��上传区埁E*/
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color .15s, background-color .15s;
    background: #fafafa;
}

.upload-zone:hover {
    border-color: #2563eb;
    background: #f0f5ff;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-zone-icon {
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.upload-zone-text {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.upload-zone-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.file-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    gap: 0.5rem;
}

.file-item-name {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s;
}

.file-item-remove:hover {
    color: #ef4444;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #555;
    background: none;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color .15s;
    margin-bottom: 1rem;
    text-decoration: none;
}

.back-btn:hover {
    background-color: #f5f5f5;
}

/* 操作按钮区 */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

/* ---- 审批人选择 ---- */
.approver-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.approver-check-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
    user-select: none;
}

.approver-check-item:hover {
    background: #f0f5ff;
    border-color: #c7d7f7;
}

.approver-check-item .form-check-input {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.approver-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.approver-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approver-title {
    font-size: 0.75rem;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- 已选审批人标签 ---- */
.selected-approver-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.approver-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #e8f0fe;
    color: #2563eb;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.approver-tag-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #6b9ff2;
    transition: color 0.15s;
}

.approver-tag-remove:hover {
    color: #dc3545;
}

/* ---- 审批人选择弹窗（复用管理画面样式）---- */
.approver-select-container {
    display: flex;
    gap: 1rem;
    min-height: 300px;
    max-height: 420px;
}

.approver-panel {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.approver-panel-title {
    padding: 0.625rem 0.875rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #444;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.approver-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.approver-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.15s;
    min-width: 0;
}

.approver-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.approver-item:hover {
    background: #f0f4ff;
}

.approver-item.selected {
    background: #e8f0fe;
}

.approver-item-hint {
    font-size: 0.75rem;
    color: #999;
    margin-left: auto;
    margin-right: 0.5rem;
}

.approver-add-btn {
    background: #4c6ef5;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.approver-add-btn:hover {
    background: #3b5de7;
}

.approver-remove-btn {
    background: #e03131;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.approver-remove-btn:hover {
    background: #c92a2a;
}

.approver-empty {
    padding: 2rem;
    text-align: center;
    color: #aaa;
    font-size: 0.8125rem;
}

/* ---- 模态弹窗（新建流程）---- */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.45);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.modal-header {
    align-items: flex-start;
}

.modal-header .btn-close {
    flex-shrink: 0;
    margin-left: auto;
}

/* ---- 审批人列表（详情页）---- */
.handler-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.handler-group {
    border-bottom: 1px solid #f0f0f0;
    padding: 0.5rem 0;
}

.handler-group:last-child {
    border-bottom: none;
}

.handler-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.handler-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.handler-reason {
    font-size: 0.8rem;
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    margin-top: 0.375rem;
}

/* 审批人分组 */
.handler-status-group {
    margin-bottom: 0.75rem;
}

.handler-status-group:last-child {
    margin-bottom: 0;
}

.handler-status-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.handler-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.handler-name-tag {
    display: inline-block;
    font-size: 0.85rem;
    color: #333;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.handler-reason-reject {
    color: #dc3545;
    background: #fff5f5;
    border: 1px solid #fecaca;
}

.handler-reason-approve {
    color: #198754;
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.handler-reason-auto {
    color: #0d47a1;
    background: #e3f2fd;
    border: 1px solid #90caf9;
}
