/* =========================================================================
   STYLE CHO ENGINE PHÊ DUYỆT TẬP TRUNG (SME-VOFFICE)
   ========================================================================= */

/* Trạng thái / Badge */
.pd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
}

.pd-badge-nhap {
    background-color: #64748b;
}

.pd-badge-choduyet {
    background-color: #0284c7;
}

.pd-badge-daduyet {
    background-color: #059669;
}

.pd-badge-tuchoi {
    background-color: #dc2626;
}

.pd-badge-trave {
    background-color: #d97706;
}

.pd-badge-dathuhoi {
    background-color: #475569;
}

.pd-badge-dahuy {
    background-color: #1e293b;
}

/* Nhóm nút hành động */
.pd-actions-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pd-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease-in-out;
}

.pd-btn:hover {
    opacity: 0.9;
}

.pd-btn-submit {
    background-color: #0284c7;
    color: #ffffff;
}

.pd-btn-approve {
    background-color: #059669;
    color: #ffffff;
}

.pd-btn-reject {
    background-color: #dc2626;
    color: #ffffff;
}

.pd-btn-return {
    background-color: #d97706;
    color: #ffffff;
}

.pd-btn-claim {
    background-color: #4f46e5;
    color: #ffffff;
}

.pd-btn-release {
    background-color: #64748b;
    color: #ffffff;
}

.pd-btn-cancel {
    background-color: #6b7280;
    color: #ffffff;
}

.pd-btn-huy {
    background-color: #991b1b;
    color: #ffffff;
}

.pd-btn-timeline {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Timeline */
.pd-timeline {
    position: relative;
    padding: 10px 0;
}

.pd-timeline-step {
    position: relative;
    padding-left: 32px;
    margin-bottom: 20px;
}

.pd-timeline-step::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: -20px;
    width: 2px;
    background-color: #e2e8f0;
}

.pd-timeline-step:last-child::before {
    display: none;
}

.pd-timeline-dot {
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
    background-color: #94a3b8;
}

.pd-timeline-dot.active {
    background-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.pd-timeline-dot.completed {
    background-color: #059669;
}

.pd-timeline-dot.rejected {
    background-color: #dc2626;
}

.pd-timeline-content {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
}

.pd-timeline-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.pd-timeline-meta {
    font-size: 12px;
    color: #64748b;
}

.pd-timeline-comment {
    margin-top: 6px;
    padding: 6px 10px;
    background-color: #ffffff;
    border-left: 3px solid #0284c7;
    border-radius: 2px;
    font-size: 12px;
    color: #334155;
}

/* =========================================================================
   HỘP VIỆC PHÊ DUYỆT (PheDuyet_HopThu.razor)
   ========================================================================= */
#gdvHopThu {
    height: calc(100vh - 150px) !important;
}

/* Tab dạng segmented control nằm trong toolbar */
.pd-segment {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background-color: #f1f5f9;
    border-radius: 8px;
}

.pd-segment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pd-segment-item:hover {
    color: #0f172a;
}

.pd-segment-item.active {
    color: #0369a1;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.pd-segment-count {
    min-width: 18px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #ffffff;
    background-color: #dc2626;
    border-radius: 9px;
}

/* Ô tiêu đề chứng từ: tiêu đề + loại chứng từ dòng phụ */
.pd-cell-title {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.pd-cell-title a,
.pd-cell-title span {
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.pd-cell-title a:hover {
    color: #0369a1;
    text-decoration: underline;
}

.pd-cell-title small {
    font-size: 11.5px;
    color: #64748b;
}

/* Chip nhỏ gọn */
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

.pd-chip-info {
    color: #0369a1;
    background-color: #e0f2fe;
}

.pd-chip-muted {
    color: #475569;
    background-color: #f1f5f9;
}

.pd-chip-danger {
    color: #b91c1c;
    background-color: #fee2e2;
}

/* Nút thao tác trên dòng: chỉ icon, hiện rõ khi hover */
.pd-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.pd-row-actions > a,
.pd-row-actions > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 16px;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pd-row-actions > a:hover,
.pd-row-actions > button:hover {
    color: #0369a1;
    background-color: #e0f2fe;
}

.pd-row-actions .pd-actions-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* Trạng thái rỗng */
.pd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 0;
    color: #94a3b8;
    font-size: 13px;
}

.pd-empty i {
    font-size: 40px;
}

/* =========================================================================
   THIẾT LẬP QUY TRÌNH PHÊ DUYỆT (PheDuyet_QuyTrinh_DanhSach.razor)
   ========================================================================= */
.pd-main-container {
    height: calc(100vh - 150px);
}

.pd-process-list-col {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pd-process-list-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pd-process-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.pd-process-card:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.pd-process-card.active {
    border-color: #0284c7;
    background-color: #f0f9ff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
    border-left: 4px solid #0284c7;
}

.pd-process-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.pd-process-card.active .pd-process-title {
    color: #0284c7;
}

.pd-process-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.pd-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

/* =========================================================================
   INPUT CHỌN MÀU SẮC (Khắc phục lỗi swatch bị lệch/vượt ra ngoài viền)
   ========================================================================= */
.form-control-color,
input[type="color"].form-control,
input[type="color"].form-control-sm {
    padding: 3px !important;
    height: 30px !important;
    border-radius: 6px !important;
    cursor: pointer;
    background-color: #ffffff !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    vertical-align: middle;
}

.form-control-color::-webkit-color-swatch-wrapper,
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    border-radius: 4px !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

.form-control-color::-webkit-color-swatch,
input[type="color"]::-webkit-color-swatch {
    border: none !important;
    border-radius: 4px !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.form-control-color::-moz-color-swatch,
input[type="color"]::-moz-color-swatch {
    border: none !important;
    border-radius: 4px !important;
    height: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

