/* ==========================================================================
   1. DASHBOARD MD3 STYLES
   ========================================================================== */
.philo-md3-dash {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    color: #1f1f1f;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.philo-md3-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.philo-md3-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px 4px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.05);
}

/* Typography */
.philo-md3-title {
    margin: 16px 0 0 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.philo-md3-desc {
    margin: 0;
    font-size: 15px;
    color: #44474e;
    line-height: 1.5;
}

/* Tonal Containers */
.md3-primary-container {
    background: #d3e3fd;
    color: #041e49;
    box-shadow: none;
    border: none;
}

.md3-primary-container .philo-md3-title {
    color: #041e49;
}

.md3-primary-container .philo-md3-desc {
    color: #001d35;
}

.md3-error-container {
    background: #f9dedc;
    color: #410e0b;
    box-shadow: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.md3-btn-error {
    background: #b3261e;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.md3-btn-error:hover {
    background: #8c1d18;
    color: #ffffff;
}

/* Grid Layout cho Metrics */
.philo-md3-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* Metric Card Inner */
.md3-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.md3-metric-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.md3-metric-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #44474e;
}

/* Specific Metric Colors */
.metric-green .md3-metric-icon { background: #c4eed0; color: #0f5223; }
.metric-green .md3-metric-value { color: #0f5223; }

.metric-blue .md3-metric-icon { background: #c2e7ff; color: #001d35; }
.metric-blue .md3-metric-value { color: #001d35; }

.metric-purple .md3-metric-icon { background: #eaddff; color: #21005d; }
.metric-purple .md3-metric-value { color: #21005d; }

@media (max-width: 768px) {
    .philo-md3-title { font-size: 24px; }
    .md3-error-container { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   2. BẢNG QUẢN LÝ DỰ ÁN (MD3 STYLES)
   ========================================================================== */
.philo-md3-projects-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

.philo-md3-projects-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 24px; 
}

/* Card Dự án */
.philo-md3-project-card { 
    display: flex; 
    flex-direction: column; 
    background: #ffffff; 
    border-radius: 24px; 
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05); 
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    overflow: hidden; 
    border: 1px solid #f0f2f5; 
}

.philo-md3-project-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 16px 4px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.05); 
}

/* Header của Card */
.philo-md3-project-header { 
    padding: 24px; 
    background: #f8fafd; /* Nền xanh siêu nhạt */
    border-bottom: 1px solid #eef2f6; 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 12px;
}

.philo-md3-project-title { 
    margin: 0 0 8px 0; 
    font-size: 20px; 
    font-weight: 700; 
    color: #041e49; 
    line-height: 1.3; 
    text-decoration: none; 
    display: block; 
    transition: color 0.2s; 
}

.philo-md3-project-title:hover { color: #0073aa; }
.philo-md3-project-meta { font-size: 13px; color: #44474e; font-weight: 500; }

/* Các thẻ Badge trạng thái */
.philo-md3-badge { 
    padding: 6px 14px; 
    border-radius: 100px; 
    font-size: 12px; 
    font-weight: 600; 
    white-space: nowrap; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
}

.badge-running { background: #c2e7ff; color: #001d35; }
.badge-warning { background: #f9dedc; color: #410e0b; }

.pulse-dot { 
    width: 8px; 
    height: 8px; 
    background: #b3261e; 
    border-radius: 50%; 
    animation: pulse-md3 1.5s infinite; 
}

/* Phần Body (Thanh tiến độ) */
.philo-md3-project-body { 
    padding: 24px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.philo-md3-progress-info { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 12px; 
    font-size: 14px; 
    font-weight: 600; 
    color: #44474e; 
}

.philo-md3-progress-track { 
    width: 100%; 
    background: #e1e2e8; 
    border-radius: 100px; 
    height: 10px; 
    overflow: hidden; 
}

.philo-md3-progress-fill { 
    background: #0f5223; 
    height: 100%; 
    border-radius: 100px; 
    transition: width 0.8s ease-out; 
}

/* Footer (Nút bấm) */
.philo-md3-project-footer { 
    padding: 20px 24px; 
    background: #ffffff; 
    border-top: 1px solid #eef2f6; 
    text-align: center; 
}

.philo-md3-btn-tonal { 
    display: block; 
    width: 100%; 
    background: #d3e3fd; 
    color: #041e49; 
    padding: 14px 24px; 
    border-radius: 100px; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 15px; 
    transition: background 0.2s, box-shadow 0.2s; 
    box-sizing: border-box; 
}

.philo-md3-btn-tonal:hover { 
    background: #b4cff9; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

/* Trạng thái trống */
.philo-md3-empty-state { 
    background: #f8fafd; 
    border-radius: 24px; 
    padding: 48px 24px; 
    text-align: center; 
    color: #44474e; 
    border: 2px dashed #c2e7ff; 
}

@keyframes pulse-md3 { 
    0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.4); } 
    70% { box-shadow: 0 0 0 6px rgba(179, 38, 30, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); } 
}

/* ==========================================================================
   3. QUẢN LÝ HÓA ĐƠN & TÀI CHÍNH (MD3 STYLES)
   ========================================================================== */
.philo-md3-invoices-wrapper { 
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
}

/* Danh sách hóa đơn */
.philo-md3-invoice-card { 
    background: #ffffff; 
    border-radius: 24px; 
    border: 1px solid #eef2f6; 
    overflow: hidden; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.03); 
}

.philo-md3-invoice-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 24px; 
    border-bottom: 1px solid #eef2f6; 
    transition: background 0.2s; 
}

.philo-md3-invoice-item:last-child { border-bottom: none; }
.philo-md3-invoice-item:hover { background: #f8fafd; }

/* Thông tin hóa đơn */
.philo-md3-invoice-info { display: flex; flex-direction: column; gap: 4px; }
.philo-md3-invoice-title { font-size: 16px; font-weight: 700; color: #1f1f1f; margin: 0; }
.philo-md3-invoice-meta { font-size: 13px; color: #44474e; }
.philo-md3-invoice-amount { font-size: 18px; font-weight: 800; color: #b3261e; }

.philo-md3-invoice-actions { display: flex; align-items: center; gap: 12px; }

/* Badge Trạng thái Hóa đơn */
.badge-error { background: #f9dedc; color: #410e0b; }
.badge-success { background: #c4eed0; color: #0f5223; }
.badge-secondary { background: #e1e2e8; color: #1d1b20; }

/* Buttons Hóa đơn */
.philo-md3-btn-pay { 
    background: #b3261e; 
    color: #ffffff; 
    border: none; 
    padding: 10px 24px; 
    border-radius: 100px; 
    font-weight: 600; 
    font-size: 14px; 
    cursor: pointer; 
    transition: all 0.2s; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.philo-md3-btn-pay:hover { background: #8c1d18; box-shadow: 0 4px 8px rgba(179,38,30,0.2); transform: translateY(-2px); }

.philo-md3-btn-download { 
    background: #d3e3fd; 
    color: #041e49; 
    padding: 10px 20px; 
    border-radius: 100px; 
    font-weight: 600; 
    font-size: 14px; 
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s; 
}
.philo-md3-btn-download:hover { background: #b4cff9; }

/* ---------------------------------------------------
   MODAL THANH TOÁN (MD3 DIALOG)
--------------------------------------------------- */
.philo-md3-modal-overlay { 
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.4); 
    align-items: center; 
    justify-content: center; 
    opacity: 0; 
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1); 
    backdrop-filter: blur(4px); 
}

.philo-md3-modal-content { 
    background: #ffffff; 
    border-radius: 28px; 
    width: 90%; 
    max-width: 480px; 
    box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12); 
    transform: translateY(-20px) scale(0.95); 
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

/* Kích hoạt animation khi hiện Modal */
.philo-md3-modal-overlay.md3-show { opacity: 1; }
.philo-md3-modal-overlay.md3-show .philo-md3-modal-content { transform: translateY(0) scale(1); }

.philo-md3-modal-header { 
    padding: 24px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #eef2f6; 
}

.philo-md3-modal-header h3 { margin: 0; font-size: 20px; font-weight: 700; color: #1f1f1f; }
.philo-md3-modal-close { 
    background: transparent; 
    border: none; 
    font-size: 24px; 
    cursor: pointer; 
    color: #44474e; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: background 0.2s; 
}
.philo-md3-modal-close:hover { background: #e1e2e8; }

.philo-md3-modal-body { padding: 24px; }

.philo-md3-qr-box { 
    text-align: center; 
    background: #f8fafd; 
    padding: 24px; 
    border-radius: 20px; 
    margin-bottom: 24px; 
    border: 1px dashed #c2e7ff;
}

.philo-md3-info-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 14px 0; 
    border-bottom: 1px solid #eef2f6; 
}
.philo-md3-info-row:last-child { border-bottom: none; }
.philo-md3-info-label { color: #44474e; font-size: 14px; font-weight: 500;}
.philo-md3-info-value { font-weight: 700; color: #1f1f1f; text-align: right; }

.philo-md3-copy-btn { 
    background: #e1e2e8; 
    border: none; 
    padding: 6px 14px; 
    border-radius: 100px; 
    font-size: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    margin-left: 12px; 
    color: #1d1b20; 
    transition: background 0.2s; 
}
.philo-md3-copy-btn:hover { background: #c7c9d1; }

@media (max-width: 768px) {
    .philo-md3-invoice-item { flex-direction: column; align-items: flex-start; gap: 16px; }
    .philo-md3-invoice-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}

/* ==========================================================================
   4. QUẢN LÝ DỊCH VỤ (MD3 STYLES)
   ========================================================================== */
.philo-md3-services-wrapper {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Card Dịch vụ */
.philo-md3-service-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid #eef2f6;
}

.philo-md3-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px 4px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.05);
}

/* Header Dịch vụ */
.philo-md3-service-header {
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid #eef2f6;
    background: #fdfdfd;
}

.philo-md3-service-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.philo-md3-service-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

/* Body Dịch vụ (Chứa ngày tháng) */
.philo-md3-service-body {
    padding: 20px 24px;
    flex: 1;
    background: #ffffff;
}

.philo-md3-service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.philo-md3-service-row:last-child {
    margin-bottom: 0;
}

.philo-md3-service-label {
    color: #44474e;
    font-weight: 500;
}

.philo-md3-service-value {
    font-weight: 700;
}

/* Footer (Nút hành động) */
.philo-md3-service-footer {
    padding: 16px 24px;
    background: #f8fafd;
    border-top: 1px solid #eef2f6;
    display: flex;
    gap: 12px;
}

.philo-md3-btn-renew {
    display: block;
    flex: 1;
    text-align: center;
    background: #b3261e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.philo-md3-btn-renew:hover {
    background: #8c1d18;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. HỒ SƠ DOANH NGHIỆP (MD3 STYLES)
   ========================================================================== */
.philo-md3-profile-wrapper { 
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
}

/* Các thông báo (Alerts) */
.philo-md3-alert { 
    padding: 16px 24px; 
    border-radius: 16px; 
    font-size: 14px; 
    font-weight: 500; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    line-height: 1.5;
}
.philo-md3-alert-success { background: #c4eed0; color: #0f5223; }
.philo-md3-alert-info { background: #d3e3fd; color: #041e49; margin-bottom: 24px; }

/* Khối Form chính */
.philo-md3-form-card { 
    background: #ffffff; 
    border-radius: 24px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 8px 3px rgba(0,0,0,0.02); 
    padding: 32px; 
    border: 1px solid #eef2f6; 
}

/* Bố cục Grid cho Form */
.philo-md3-form-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 24px; 
    margin-bottom: 24px; 
}

.philo-md3-input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.philo-md3-label { 
    font-size: 14px; 
    font-weight: 600; 
    color: #1f1f1f; 
}
.philo-md3-label span { color: #b3261e; } /* Dấu sao đỏ bắt buộc */

/* Các ô Input */
.philo-md3-input { 
    padding: 14px 16px !important; 
    border: 1px solid #74777f !important; 
    border-radius: 12px !important; 
    font-size: 15px; 
    color: #1f1f1f; 
    outline: none; 
    transition: border-color 0.2s, box-shadow 0.2s !important; 
    background: #ffffff; 
    font-family: inherit; 
    width: 100% !important;
    box-sizing: border-box !important;
}
.philo-md3-input:focus { 
    border-color: #0b57d0; 
    box-shadow: 0 0 0 1px #0b57d0; 
}
.philo-md3-input:disabled { 
    background: #f3f4f9; 
    color: #74777f; 
    border-color: #e1e2e8; 
    cursor: not-allowed; 
}

/* Nút Submit */
.philo-md3-form-footer { 
    text-align: right; 
    border-top: 1px solid #eef2f6; 
    padding-top: 24px; 
    margin-top: 8px; 
}

/* Nút Primary (Chính - Đổ nền xanh) */
button.philo-md3-btn-primary, 
a.philo-md3-btn-primary { 
    background: #0b57d0 !important; 
    color: #ffffff !important; 
    border: none !important; 
    padding: 12px 32px !important; 
    border-radius: 100px !important; /* Bo tròn viên thuốc */
    font-weight: 600 !important; 
    font-size: 15px !important; 
    cursor: pointer !important; 
    transition: all 0.2s ease !important; 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    gap: 8px !important; 
    line-height: 1.5 !important;
    box-shadow: none !important;
}
button.philo-md3-btn-primary:hover, 
a.philo-md3-btn-primary:hover { 
    background: #0842a0 !important; 
    transform: translateY(-2px) !important; 
    box-shadow: 0 4px 8px rgba(11, 87, 208, 0.2) !important;
}

/* Nút Outlined (Phụ - Viền, nền trắng) */
button.philo-md3-btn-outlined, 
a.philo-md3-btn-outlined {
    background: #ffffff !important;
    color: #0b57d0 !important;
    border: 1px solid #74777f !important;
    padding: 10px 24px !important;
    border-radius: 100px !important; /* Bo tròn viên thuốc */
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: none !important;
}
button.philo-md3-btn-outlined:hover, 
a.philo-md3-btn-outlined:hover {
    background: #f0f6fc !important;
    border-color: #0b57d0 !important;
    color: #041e49 !important;
}

@media (max-width: 768px) {
    .philo-md3-form-grid { grid-template-columns: 1fr; gap: 16px; }
    .philo-md3-form-card { padding: 24px; }
}

/* ==========================================================================
   6. TỔNG QUAN HỢP ĐỒNG (MD3 STYLES)
   ========================================================================== */
.philo-md3-contract-summary {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin-bottom: 24px;
}

/* Header: Tiêu đề & Tổng tiền */
.philo-md3-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #eef2f6;
    padding-bottom: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.philo-md3-summary-title {
    margin: 0 0 10px 0;
    color: #1f1f1f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.philo-md3-summary-val-box {
    text-align: right;
}

.philo-md3-summary-val-label {
    font-size: 13px;
    color: #44474e;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.philo-md3-summary-val {
    font-size: 26px;
    color: #b3261e; /* Màu đỏ nổi bật cho phần tài chính */
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

/* Khối Thông tin Account Manager (AM) */
.philo-md3-am-box {
    background: #f8fafd;
    border: 1px solid #d3e3fd;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.philo-md3-am-title {
    margin: 0;
    font-size: 14px;
    color: #041e49;
    font-weight: 700;
}

.philo-md3-am-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Avatar bo góc vuông bo tròn (Squircle) chuẩn MD3 */
.philo-md3-am-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px; 
    background: #c2e7ff;
    color: #001d35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.philo-md3-am-details strong {
    color: #001d35;
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.philo-md3-am-details span {
    font-size: 14px;
    color: #44474e;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .philo-md3-summary-val-box { text-align: left; }
}

/* ==========================================================================
   7. CHI TIẾT HỢP ĐỒNG - TIẾN ĐỘ GIAI ĐOẠN (MD3 STYLES)
   ========================================================================== */
.philo-md3-phases-wrapper { 
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif; 
    margin-bottom: 24px; 
}

/* Header & Progress Bar */
.philo-md3-phases-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #eef2f6; 
    padding-bottom: 20px; 
    margin-bottom: 24px; 
}

.philo-md3-phases-title { 
    margin: 0 0 4px 0; 
    color: #1f1f1f; 
    font-size: 20px; 
    font-weight: 700; 
}

.philo-md3-phases-subtitle { 
    color: #44474e; 
    font-size: 14px; 
    margin: 0; 
}

.philo-md3-phases-progress { 
    margin-bottom: 32px; 
    background: #f8fafd; 
    padding: 20px; 
    border-radius: 16px; 
    border: 1px solid #eef2f6;
}

/* Stepper / Timeline */
.philo-md3-stepper { 
    list-style: none; 
    padding: 0; 
    margin: 0 0 0 16px; 
    border-left: 2px solid #eef2f6; 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
}

.philo-md3-step { 
    position: relative; 
    padding-left: 32px; 
}

/* Icon cắt đứt đường Timeline */
.philo-md3-step-icon { 
    position: absolute; 
    left: -17px; 
    top: 0; 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
    border: 4px solid #ffffff; 
    z-index: 2; 
    box-sizing: border-box; 
}

/* Màu sắc của Icon Timeline theo trạng thái */
.step-success { background: #c4eed0; color: #0f5223; }
.step-active  { background: #c2e7ff; color: #001d35; }
.step-warning { background: #f9dedc; color: #410e0b; }
.step-pending { background: #e1e2e8; color: #44474e; }

/* Nội dung của từng Giai đoạn */
.philo-md3-step-content { 
    background: #ffffff; 
    border-radius: 16px; 
    padding: 16px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 16px; 
    border: 1px solid #eef2f6; 
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.02); 
}

.philo-md3-step-content:hover { 
    box-shadow: 0 4px 8px rgba(0,0,0,0.04); 
    border-color: #c2e7ff; 
    transform: translateX(4px); /* Nhích nhẹ sang phải khi Hover */
}

.philo-md3-step-info a { 
    color: #1f1f1f; 
    font-size: 16px; 
    font-weight: 700; 
    text-decoration: none; 
    display: block; 
    margin-bottom: 4px; 
    transition: color 0.2s; 
}

.philo-md3-step-info a:hover { color: #0b57d0; }
.philo-md3-step-meta { font-size: 13px; font-weight: 600; display: block; }

/* Nút Action đặc biệt */
.philo-md3-btn-review { 
    background: #b3261e; 
    color: #ffffff; 
    padding: 10px 20px; 
    border-radius: 100px; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 13px; 
    white-space: nowrap; 
    transition: background 0.2s; 
    box-shadow: 0 1px 3px rgba(179, 38, 30, 0.2); 
}

.philo-md3-btn-review:hover { background: #8c1d18; }

@media (max-width: 768px) {
    .philo-md3-step-content { flex-direction: column; align-items: flex-start; }
    .philo-md3-btn-review { width: 100%; text-align: center; box-sizing: border-box; }
}

/* ==========================================================================
   8. HỒ SƠ PHÁP LÝ & CỔNG KÝ KẾT (MD3 STYLES)
   ========================================================================== */
.philo-md3-docs-wrapper {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin-bottom: 24px;
}

/* Danh sách Tài liệu */
.philo-md3-doc-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.philo-md3-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafd;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.philo-md3-doc-item:hover {
    background: #ffffff;
    border-color: #c2e7ff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transform: translateY(-2px);
}

.philo-md3-doc-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.philo-md3-doc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* Đổi màu icon theo loại tài liệu */
.doc-icon-quote { background: #eaddff; color: #21005d; }
.doc-icon-contract { background: #c4eed0; color: #0f5223; }
.doc-icon-custom { background: #f9dedc; color: #410e0b; }
.doc-icon-success { background: #c2e7ff; color: #001d35; }

.philo-md3-doc-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f1f1f;
    margin: 0;
}

/* Khu vực Ký kết (Tabs) */
.philo-md3-sign-area {
    border: 2px dashed #c2e7ff;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 16px;
}

.philo-md3-sign-header {
    background: #f0f6fc;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #cce5ff;
}

.philo-md3-sign-header h4 {
    margin: 0 0 4px 0;
    color: #041e49;
    font-size: 18px;
    font-weight: 700;
}

/* Tab Navigation */
.philo-md3-tabs {
    display: flex;
    background: #fdfdfd;
    border-bottom: 1px solid #eef2f6;
}

.philo-md3-tab-btn {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    font-weight: 600;
    color: #44474e;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.philo-md3-tab-btn.active {
    color: #0b57d0;
    border-bottom-color: #0b57d0;
    background: #ffffff;
}

.philo-md3-tab-btn:hover:not(.active) {
    background: #f4f7fc;
}

/* Tab Content */
.philo-md3-tab-content {
    padding: 24px;
    display: none;
    background: #ffffff;
}
.philo-md3-tab-content.active {
    display: block;
    animation: md3FadeIn 0.3s ease;
}

/* Canvas Ký tên */
.philo-md3-canvas-wrapper {
    border: 2px solid #e1e2e8;
    background: #fdfdfd;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 16px;
    overflow: hidden;
}

@keyframes md3FadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .philo-md3-tabs { flex-direction: column; }
    .philo-md3-tab-btn { border-bottom: 1px solid #eef2f6; border-left: 3px solid transparent; text-align: left; padding: 12px 20px;}
    .philo-md3-tab-btn.active { border-bottom-color: #eef2f6; border-left-color: #0b57d0; }
}

/* ==========================================================================
   9. CHI TIẾT GIAI ĐOẠN (CHECKLIST & THÔNG TIN) - MD3 STYLES
   ========================================================================== */
.philo-md3-phase-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

/* Cột Trái: Checklist & Mô tả */
.philo-md3-phase-main {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cột Phải: Thông tin meta */
.philo-md3-phase-sidebar {
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Khối chung */
.philo-md3-card-box {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 8px 3px rgba(0,0,0,0.02);
    border: 1px solid #eef2f6;
    overflow: hidden;
}

/* Header của khối */
.philo-md3-box-header {
    background: #fdfdfd;
    padding: 20px 24px;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.philo-md3-box-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f1f1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.philo-md3-box-meta {
    font-size: 14px;
    color: #44474e;
    font-weight: 600;
}

/* Nội dung khối */
.philo-md3-box-body {
    padding: 24px;
}

/* Thanh Tiến độ Checklist */
.philo-md3-cl-progress-track {
    width: 100%;
    background: #e1e2e8;
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.philo-md3-cl-progress-fill {
    background: #0f5223;
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.2, 0, 0, 1);
}

/* Danh sách Checklist */
.philo-md3-cl-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.philo-md3-cl-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    transition: background 0.2s;
}

/* Trạng thái chưa xong */
.philo-md3-cl-item.pending {
    background: #f8fafd;
    border: 1px solid #d3e3fd;
}
.philo-md3-cl-item.pending .cl-icon { color: #001d35; }
.philo-md3-cl-item.pending .cl-text { color: #1f1f1f; font-weight: 500; }

/* Trạng thái đã xong */
.philo-md3-cl-item.done {
    background: #fdfdfd;
    border: 1px solid #eef2f6;
    opacity: 0.7;
}
.philo-md3-cl-item.done .cl-icon { color: #0f5223; }
.philo-md3-cl-item.done .cl-text { text-decoration: line-through; color: #74777f; }

/* Khu vực Mô tả */
.philo-md3-content-box {
    font-size: 15px;
    color: #44474e;
    line-height: 1.6;
}

/* Hàng Thông tin Timeline */
.philo-md3-timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}
.philo-md3-timeline-row:last-child { border-bottom: none; }
.timeline-label { color: #44474e; font-size: 14px; }
.timeline-val { color: #1f1f1f; font-size: 15px; font-weight: 700; }
.timeline-val.deadline { color: #b3261e; }

/* Thẻ Nhân sự (AM/Tech) */
.philo-md3-user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #f8fafd;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: background 0.2s;
}
.philo-md3-user-card:last-child { margin-bottom: 0; }
.philo-md3-user-card:hover { background: #eef2f6; }

.philo-md3-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #c2e7ff;
    color: #001d35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.philo-md3-user-info strong {
    color: #1f1f1f;
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.philo-md3-user-info span {
    font-size: 13px;
    color: #44474e;
}

@media (max-width: 992px) {
    .philo-md3-phase-sidebar { width: 100%; }
}

/* ==========================================================================
   10. TRẠM NGHIỆM THU & PHẢN HỒI (MD3 STYLES)
   ========================================================================== */
.philo-md3-feedback-wrapper {
    padding: 32px;
}

/* Bảng Lịch sử Feedback */
.philo-md3-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 32px;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    background: #ffffff;
}

.philo-md3-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
    text-align: left;
}

.philo-md3-table th {
    background: #f8fafd;
    padding: 16px;
    font-weight: 600;
    color: #44474e;
    border-bottom: 1px solid #eef2f6;
}

.philo-md3-table td {
    padding: 16px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: top;
    color: #1f1f1f;
    line-height: 1.5;
}

.philo-md3-table tr:last-child td { border-bottom: none; }

/* Khối Action Hành động (Nghiệm thu / Reject) */
.philo-md3-action-box {
    background: #f8fafd;
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    border: 1px dashed #c2e7ff;
}

.philo-md3-action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

.philo-md3-btn-success {
    background: #0f5223;
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 100px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(15, 82, 35, 0.2);
    width: 100%;
    box-sizing: border-box;
}
.philo-md3-btn-success:hover { background: #0a3818; transform: translateY(-2px); }

.philo-md3-btn-outline-error {
    background: transparent;
    color: #b3261e;
    border: 1px solid #b3261e;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.philo-md3-btn-outline-error:hover { background: #f9dedc; }

.philo-md3-btn-disabled {
    background: #e1e2e8;
    color: #74777f;
    border: none;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    cursor: not-allowed;
    width: 100%;
    box-sizing: border-box;
}

/* Form nhập Feedback */
.philo-md3-feedback-row {
    background: #ffffff;
    border: 1px solid #eef2f6;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.philo-md3-dropzone {
    border: 2px dashed #a8c7fa;
    background: #fdfdfd;
    padding: 24px 16px;
    text-align: center;
    border-radius: 16px;
    cursor: pointer;
    color: #0b57d0;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100% - 26px);
    box-sizing: border-box;
}
.philo-md3-dropzone:hover { background: #f0f6fc; border-color: #0b57d0; }

.philo-md3-btn-remove-row {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #b3261e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background 0.2s;
    z-index: 10;
}
.philo-md3-btn-remove-row:hover { background: #8c1d18; }

/* Các trạng thái End-state */
.philo-md3-state-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
}

@media (max-width: 768px) {
    .philo-md3-feedback-wrapper { padding: 20px; }
    .philo-md3-action-buttons { flex-direction: column; }
    .philo-md3-feedback-row { flex-direction: column; }
}

/* ==========================================================================
   11. CHI TIẾT HỢP ĐỒNG - TIẾN ĐỘ THANH TOÁN (MD3 STYLES)
   ========================================================================== */
.philo-md3-contract-invoices {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 8px 3px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eef2f6;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin-bottom: 24px;
}

.philo-md3-ci-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Từng đợt thanh toán */
.philo-md3-ci-item {
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    gap: 16px;
}

.philo-md3-ci-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border-color: #c2e7ff;
    background: #ffffff;
    transform: translateY(-2px);
}

/* Highlight những đợt chưa thanh toán */
.philo-md3-ci-item.pending-pay {
    background: #fff8e5; 
    border-color: #f9dedc;
}

.philo-md3-ci-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.philo-md3-ci-info strong {
    font-size: 16px;
    color: #1f1f1f;
    font-weight: 700;
    margin: 0;
}

.philo-md3-ci-amount {
    font-size: 20px;
    font-weight: 800;
    color: #b3261e; /* Đỏ nhấn mạnh tài chính */
    margin: 0;
    line-height: 1;
}

/* Khu vực Nút / Badge bên phải */
.philo-md3-ci-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Các link thao tác (Thanh toán / Tải file) */
.philo-md3-ci-action-link {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 100px;
    background: #f8fafd;
}

.philo-md3-ci-action-link.pay { 
    color: #0b57d0; 
    background: #d3e3fd;
    cursor: pointer; 
}
.philo-md3-ci-action-link.pay:hover { 
    background: #b4cff9; 
}

.philo-md3-ci-action-link.download { 
    color: #0f5223; 
    background: #c4eed0;
}
.philo-md3-ci-action-link.download:hover {
    background: #a8e0b9;
}

.philo-md3-ci-action-link.search { 
    color: #001d35; 
    background: #c2e7ff;
}

@media (max-width: 768px) {
    .philo-md3-ci-item { flex-direction: column; align-items: flex-start; }
    .philo-md3-ci-actions { width: 100%; align-items: flex-start; flex-direction: row-reverse; justify-content: space-between; }
}

/* ==========================================================================
   12. FORM NHẬN YÊU CẦU (BRIEF) - MD3 STYLES
   ========================================================================== */
.philo-md3-brief-wrapper {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin-bottom: 32px;
}

/* Header Form Brief (Cảnh báo) */
.philo-md3-brief-header {
    background: #fff8e5; /* Nền vàng nhạt nhẹ nhàng */
    padding: 20px 24px;
    border-radius: 16px; /* Bo góc tròn đều cực mượt */
    margin-bottom: 28px;
    border: 1px dashed #ffdf85; /* Thêm viền đứt nét nhẹ tạo điểm nhấn */
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.philo-md3-brief-header h4 {
    margin: 0;
    color: #8c1d18; /* Màu chữ đỏ trầm tinh tế hơn */
    font-size: 16px;
    font-weight: 700;
}

.philo-md3-brief-header p {
    margin: 0;
    font-size: 14px;
    color: #44474e;
    line-height: 1.5;
}

/* Các hàng đặc biệt trong Form (Section) */
.philo-md3-brief-section-row {
    background: #ffffff;
    border: 1px solid #eef2f6;
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* File Upload dạng cơ bản (Cho Logo) */
.philo-md3-file-upload {
    border: 2px dashed #c2e7ff;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafd;
    transition: all 0.2s;
}
.philo-md3-file-upload:hover { border-color: #0b57d0; background: #f0f6fc; }
.philo-md3-file-upload input[type="file"] { width: 100%; cursor: pointer; color: #44474e; font-size: 14px; }

/* Trạng thái đã gửi Brief thành công */
.philo-md3-brief-success-box {
    background: #f8fafd;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.philo-md3-brief-success-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.philo-md3-brief-success-info h4 { margin: 0 0 4px 0; color: #1f1f1f; font-size: 16px; font-weight: 700; }
.philo-md3-brief-success-info p { margin: 0; font-size: 14px; color: #44474e; }

@media (max-width: 768px) {
    .philo-md3-brief-section-row { flex-direction: column; }
    .philo-md3-brief-success-box { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ==========================================================================
   13. THANH CẢNH BÁO NHẮC VIỆC (MD3 STYLES)
   ========================================================================== */
.philo-md3-alerts-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

/* Thẻ cảnh báo MD3 */
.philo-md3-alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-radius: 20px;
    gap: 20px;
    background: #fff8e5; /* Nền vàng nhạt cảnh báo */
    border: 1px dashed #ffdf85;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.philo-md3-alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.philo-md3-alert-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.philo-md3-alert-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.philo-md3-alert-text h4 {
    margin: 0 0 6px 0;
    color: #8c1d18; /* Chữ đỏ trầm tinh tế */
    font-size: 16px;
    font-weight: 700;
}

.philo-md3-alert-text p {
    margin: 0;
    font-size: 14px;
    color: #44474e;
    line-height: 1.5;
}

.philo-md3-alert-text p strong {
    color: #1f1f1f;
}

/* Nút bổ sung ngay */
.philo-md3-alert-btn {
    background: #b3261e;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.philo-md3-alert-btn:hover {
    background: #8c1d18;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(179, 38, 30, 0.3);
}

@media (max-width: 768px) {
    .philo-md3-alert-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .philo-md3-alert-btn {
        width: 100%;
    }
}