/* Container chính cho Phiếu Giao */
.pg-detail-wrapper {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    /* Tăng đệm dưới để không bị Footer che mất nội dung cuối cùng */
    padding-bottom: 120px; 
    box-sizing: border-box;
}

.pg-master-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 25px;
    border-left: 5px solid #007bff;
}

/* Grid logic: Desktop 4 - Mobile/Tablet 2 */
.pg-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 20px;
}

/* Mobile & Tablet vẫn giữ 2 cột */
@media (max-width: 1024px) {
    .pg-info-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

.pg-info-item {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Tránh tràn layout do text dài */
}

/* Ghi chú lấn không gian cuối hàng */
.pg-info-item.pg-full-width {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .pg-info-item.pg-full-width {
        grid-column: 1 / -1; 
    }
}

.pg-info-item label {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.pg-info-item span {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    word-wrap: break-word;
}

/* Footer hành động */
.pg-detail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 15px; /* Giảm padding để tiết kiệm diện tích mobile */
    display: flex;
    justify-content: center; /* Căn giữa ngang */
    align-items: center;     /* Căn giữa dọc - Quan trọng để nút không cao thấp */
    gap: 12px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    z-index: 999;
    height: 70px; /* Cố định chiều cao footer */
    box-sizing: border-box;
}

/* Nút Footer */
.pg-footer-btn {
    flex: 1;
    max-width: 160px; /* Giảm nhẹ để an toàn cho mobile nhỏ */
    height: 40px;     /* Cố định chiều cao tuyệt đối */
    padding: 0 10px !important; /* Reset padding của hệ thống */
    margin: 0 !important;       /* Reset margin của hệ thống */
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    white-space: nowrap; /* Không cho phép nhảy dòng chữ trong nút */
    cursor: pointer;
    box-sizing: border-box;
    line-height: normal !important; /* Reset line-height */
}


/* Tab System - Tối ưu cực hạn chiều cao */
.pg-detail-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}

.pg-tab-btn {
    padding: 6px 12px; /* Nhỏ lại */
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.85rem; /* Chữ nhỏ hơn */
    color: #b0b0b0 !important; /* Xám nhạt hẳn khi không chọn */
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    text-transform: none; /* Viết thường tự nhiên */
}

/* Khi tab được chọn - Ép màu xanh đậm tuyệt đối */
.pg-tab-btn.active {
    color: #004085 !important; /* Xanh đậm chuyên nghiệp */
    border-bottom: 2px solid #004085 !important;
    font-weight: 700;
}

.pg-tab-btn:hover:not(.active) {
    color: #666 !important;
}

/* Tiêu đề trong tab gọn hơn */
.pg-tab-content h3 {
    font-size: 0.95rem;
    margin: 0;
    color: #555;
}


.pg-child-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pg-child-header { display: grid; background: #f8f9fa; padding: 10px; font-weight: bold; border-bottom: 1px solid #eee; color: #555; }
.pg-child-row { display: grid; padding: 12px 10px; border-bottom: 1px solid #eee; cursor: pointer; transition: background 0.2s; align-items: center; }
.pg-child-row:hover { background: #f0f7ff; }
.pg-child-row b { color: #0056b3; }
.child-note { grid-column: 1 / -1; font-size: 0.8rem; color: #888; margin-top: 4px; font-style: italic; }

.pg-lock-msg {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    width: 100%;
    border: 1px solid #ffeeba;
    font-style: italic;
}

.pg-detail-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
}
