/*
 * ============================================================================
 *  GIAO DIỆN PHẦN MỀM QUẢN LÝ CÔNG VIỆC
 * ============================================================================
 *  File CSS thuần, không cần build (không cần Node.js trên hosting).
 *  Được nạp sau CSS gốc của Filament nên các quy tắc ở đây ghi đè giao diện mặc định.
 *
 *  Cấu trúc:
 *    1. Biến màu dùng chung (sáng / tối)
 *    2. Khung trang: nền, thanh trên, menu bên trái, tiêu đề
 *    3. Thành phần Filament: khung (section), bảng, nhãn trạng thái, tab, nút
 *    4. Thành phần riêng: logo, người dùng, ảnh đại diện, thẻ tiến độ, thẻ KPI,
 *       thanh phần trăm, bảng số liệu, nhãn xếp loại
 *    5. Điện thoại và máy tính bảng
 *
 *  Quy ước: chỉ dùng tên lớp đầy đủ, dễ hiểu; không dùng !important trừ khi
 *  bắt buộc phải thắng lớp tiện ích của Filament.
 * ============================================================================
 */

/* ---------------------------------------------------------------------------
 * 1. Biến màu dùng chung
 * ------------------------------------------------------------------------- */
:root {
    --app-page-background: #f5f7fb;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafc;
    --app-border: #e6eaf0;
    --app-border-strong: #d8dee8;
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --app-text-soft: #94a3b8;
    --app-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
    --app-shadow-card-hover: 0 4px 14px rgba(15, 23, 42, 0.08);
    --app-radius-card: 1rem;
    --app-radius-control: 0.65rem;

    --app-blue: #2563eb;
    --app-blue-soft: #e8f0fe;
    --app-green: #10b981;
    --app-green-soft: #e7f8f1;
    --app-purple: #8b5cf6;
    --app-purple-soft: #f1ecfe;
    --app-amber: #f59e0b;
    --app-amber-soft: #fef4e2;
    --app-red: #e11d48;
    --app-red-soft: #fde8ec;
    --app-sky: #0ea5e9;
    --app-sky-soft: #e5f5fd;
    --app-track: #edf1f6;
}

.dark {
    --app-page-background: #0b1120;
    --app-surface: #111827;
    --app-surface-muted: #0f172a;
    --app-border: #1f2937;
    --app-border-strong: #273244;
    --app-text: #f1f5f9;
    --app-text-muted: #94a3b8;
    --app-text-soft: #64748b;
    --app-shadow-card: none;
    --app-shadow-card-hover: 0 4px 14px rgba(0, 0, 0, 0.35);

    --app-blue-soft: rgba(37, 99, 235, 0.16);
    --app-green-soft: rgba(16, 185, 129, 0.15);
    --app-purple-soft: rgba(139, 92, 246, 0.17);
    --app-amber-soft: rgba(245, 158, 11, 0.15);
    --app-red-soft: rgba(225, 29, 72, 0.16);
    --app-sky-soft: rgba(14, 165, 233, 0.15);
    --app-track: #1f2937;
}

/* ---------------------------------------------------------------------------
 * 2. Khung trang
 * ------------------------------------------------------------------------- */
.fi-body {
    background-color: var(--app-page-background);
    color: var(--app-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "tnum" 0;
}

/* Thanh trên cùng */
.fi-topbar > nav {
    background-color: var(--app-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--app-border);
}

.dark .fi-topbar > nav {
    background-color: var(--app-surface);
}

/* Menu bên trái */
.fi-sidebar {
    background-color: var(--app-surface);
    border-right: 1px solid var(--app-border);
}

.dark .fi-sidebar {
    background-color: var(--app-surface);
}

.fi-sidebar-header {
    background-color: var(--app-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--app-border);
}

.fi-sidebar-nav {
    padding-top: 1.25rem;
}

.fi-sidebar-nav-groups {
    row-gap: 1.35rem;
}

/* Tên nhóm menu: chữ in hoa nhỏ, màu nhạt (giống "MENU CHÍNH") */
.fi-sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-text-soft);
}

.fi-sidebar-group-button {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.fi-sidebar-item-button {
    padding: 0.6rem 0.75rem;
    border-radius: var(--app-radius-control);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.fi-sidebar-item-label {
    font-weight: 500;
    color: #334155;
}

.dark .fi-sidebar-item-label {
    color: #cbd5e1;
}

.fi-sidebar-item-icon {
    width: 1.35rem;
    height: 1.35rem;
    color: #64748b;
}

.fi-sidebar-item-button:hover {
    background-color: var(--app-surface-muted);
}

/* Mục đang mở: nền xanh nhạt, chữ và biểu tượng màu chủ đạo */
.fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background-color: var(--app-blue-soft);
}

.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: rgb(var(--primary-600));
    font-weight: 600;
}

.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: rgb(var(--primary-400));
}

/* Tiêu đề trang */
.fi-header-heading {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--app-text);
}

.fi-header-subheading {
    margin-top: 0.35rem;
    font-size: 0.95rem;
    color: var(--app-text-muted);
}

/* ---------------------------------------------------------------------------
 * 3. Thành phần Filament
 * ------------------------------------------------------------------------- */

/* Khung nội dung (section) và khung bảng */
.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart > .fi-section {
    border-radius: var(--app-radius-card);
    box-shadow: var(--app-shadow-card);
    --tw-ring-color: var(--app-border);
}

.fi-section-header-heading {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--app-text);
}

.fi-section-header-description {
    color: var(--app-text-muted);
}

/* Bảng: tiêu đề cột in hoa nhỏ, nền nhạt, dòng thoáng */
.fi-ta-header-ctn {
    border-color: var(--app-border);
}

.fi-ta-header-cell {
    background-color: var(--app-surface-muted);
}

.fi-ta-header-cell-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

.fi-ta-cell {
    vertical-align: middle;
}

.fi-ta-row {
    transition: background-color 0.12s ease;
}

.fi-ta-row:hover {
    background-color: var(--app-surface-muted);
}

/* Nhãn trạng thái dạng viên thuốc */
.fi-badge {
    border-radius: 999px;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    font-weight: 600;
}

/* Tab */
.fi-tabs {
    border-radius: var(--app-radius-card);
    box-shadow: var(--app-shadow-card);
}

.fi-tabs-item {
    border-radius: var(--app-radius-control);
}

/* Nút và ô nhập: bo góc mềm hơn */
.fi-btn,
.fi-input-wrp,
.fi-select-input,
.fi-dropdown-panel {
    border-radius: var(--app-radius-control);
}

.fi-btn {
    font-weight: 600;
}

/* Thẻ thống kê mặc định của Filament */
.fi-wi-stats-overview-stat {
    padding: 1.25rem 1.35rem;
}

/* ---------------------------------------------------------------------------
 * 4. Thành phần riêng của phần mềm
 * ------------------------------------------------------------------------- */

/* 4.1 Logo trên menu */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.brand-logo__mark {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, rgb(var(--primary-500)), rgb(var(--primary-700)));
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.brand-logo__name {
    overflow: hidden;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--app-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 4.2 Tên và chức danh cạnh ảnh đại diện (góc phải thanh trên) */
.user-identity {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 0.85rem;
    margin-right: 0.15rem;
    line-height: 1.2;
    text-align: right;
}

.user-identity__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-text);
}

.user-identity__role {
    font-size: 0.72rem;
    color: var(--app-text-muted);
}

@media (min-width: 768px) {
    .user-identity {
        display: flex;
    }
}

/* 4.3 Ảnh đại diện + tên trong bảng */
.person-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.person-cell__avatar {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--app-surface);
}

.person-cell__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.person-cell__name {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--app-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.person-cell__detail {
    font-size: 0.75rem;
    color: var(--app-text-muted);
}

.person-stack {
    display: inline-flex;
    align-items: center;
}

.person-stack__avatar {
    width: 1.75rem;
    height: 1.75rem;
    margin-left: -0.45rem;
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--app-surface);
}

.person-stack__avatar:first-child {
    margin-left: 0;
}

.person-stack__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-left: -0.45rem;
    border-radius: 999px;
    background: var(--app-track);
    color: var(--app-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--app-surface);
}

/* 4.4 Khối có tiêu đề riêng (dùng cho widget tự vẽ) */
.panel-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-block__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-block__title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--app-text);
}

.panel-block__description {
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--app-text-muted);
}

/* Nút chọn phạm vi (Của tôi / Phòng ban / Toàn công ty) */
.segmented-control {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--app-border);
    border-radius: 0.75rem;
    background: var(--app-surface);
}

.segmented-control__option {
    padding: 0.35rem 0.8rem;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.segmented-control__option:hover {
    color: var(--app-text);
}

.segmented-control__option--active {
    background: var(--app-blue-soft);
    color: rgb(var(--primary-600));
}

.dark .segmented-control__option--active {
    color: rgb(var(--primary-400));
}

/* 4.5 Thẻ tiến độ công việc ngày / tuần / tháng */
.work-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.work-progress-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.25rem 1.35rem 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-card);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.work-progress-card:hover {
    box-shadow: var(--app-shadow-card-hover);
    transform: translateY(-1px);
}

.work-progress-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.work-progress-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

.work-progress-card__value {
    margin-top: 0.45rem;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.work-progress-card__done {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

.work-progress-card__total {
    font-size: 0.95rem;
    color: var(--app-text-soft);
}

.work-progress-card__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.8rem;
}

.work-progress-card__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.work-progress-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

.work-progress-card__percent {
    font-weight: 700;
    color: var(--app-text);
}

.work-progress-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--app-border);
    font-size: 0.76rem;
    color: var(--app-text-muted);
}

.work-progress-card__footer-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.work-progress-card__footer-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
}

/* Màu cho từng loại thẻ */
.work-progress-card--day .work-progress-card__icon {
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.work-progress-card--day .progress-track__fill {
    background: var(--app-blue);
}

.work-progress-card--week .work-progress-card__icon {
    background: var(--app-green-soft);
    color: var(--app-green);
}

.work-progress-card--week .progress-track__fill {
    background: var(--app-green);
}

.work-progress-card--month .work-progress-card__icon {
    background: var(--app-purple-soft);
    color: var(--app-purple);
}

.work-progress-card--month .progress-track__fill {
    background: var(--app-purple);
}

/* 4.6 Thanh tiến độ dùng chung */
.progress-track {
    position: relative;
    overflow: hidden;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--app-track);
}

.progress-track--thin {
    height: 0.32rem;
}

.progress-track__fill {
    height: 100%;
    border-radius: 999px;
    background: var(--app-blue);
    transition: width 0.6s ease;
}

.progress-track__fill--good {
    background: var(--app-green);
}

.progress-track__fill--warning {
    background: var(--app-amber);
}

.progress-track__fill--danger {
    background: var(--app-red);
}

/* 4.7 Phần trăm + thanh nhỏ trong bảng KPI */
.percent-meter {
    min-width: 4.25rem;
}

.percent-meter__value {
    font-size: 0.85rem;
    font-weight: 700;
}

.percent-meter__value--good {
    color: #059669;
}

.percent-meter__value--warning {
    color: #b45309;
}

.percent-meter__value--danger {
    color: var(--app-red);
}

.dark .percent-meter__value--good {
    color: #34d399;
}

.dark .percent-meter__value--warning {
    color: #fbbf24;
}

.percent-meter .progress-track {
    margin-top: 0.25rem;
}

/* 4.8 Thẻ chỉ số KPI */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
    gap: 0.85rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-card);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-card);
}

.metric-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.metric-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--app-text-muted);
}

.metric-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
}

.metric-card__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.metric-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--app-text);
}

.metric-card__hint {
    font-size: 0.74rem;
    color: var(--app-text-muted);
}

.metric-card--blue .metric-card__icon { background: var(--app-blue-soft); color: var(--app-blue); }
.metric-card--red .metric-card__icon { background: var(--app-red-soft); color: var(--app-red); }
.metric-card--red.metric-card--highlight .metric-card__value { color: var(--app-red); }
.metric-card--green .metric-card__icon { background: var(--app-green-soft); color: var(--app-green); }
.metric-card--sky .metric-card__icon { background: var(--app-sky-soft); color: var(--app-sky); }
.metric-card--amber .metric-card__icon { background: var(--app-amber-soft); color: var(--app-amber); }
.metric-card--purple .metric-card__icon { background: var(--app-purple-soft); color: var(--app-purple); }

/* 4.9 Bảng số liệu tự vẽ (KPI nhân viên, theo phòng ban, theo loại việc) */
.data-table-wrapper {
    overflow-x: auto;
    margin: 0 -0.25rem;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.data-table--wide {
    min-width: 56rem;
}

.data-table--wide th,
.data-table--wide td {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.data-table th {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-muted);
    color: var(--app-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table th:first-child {
    border-top-left-radius: 0.6rem;
}

.data-table th:last-child {
    border-top-right-radius: 0.6rem;
}

.data-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: var(--app-surface-muted);
}

.data-table .data-table__number {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.data-table .data-table__strong {
    font-weight: 700;
}

.data-table .data-table__danger {
    color: var(--app-red);
    font-weight: 700;
}

.data-table .data-table__success {
    color: #059669;
}

.dark .data-table .data-table__success {
    color: #34d399;
}

.data-table .data-table__muted {
    color: var(--app-text-soft);
}

.data-table .data-table__warning {
    color: #b45309;
}

.data-table .data-table__empty {
    padding: 1.5rem;
    color: var(--app-text-muted);
    text-align: center;
}

.data-table__total-row td {
    background: var(--app-blue-soft);
    font-weight: 700;
}

.data-table__link {
    color: rgb(var(--primary-600));
    font-weight: 600;
}

.data-table__link:hover {
    text-decoration: underline;
}

.dark .data-table__link {
    color: rgb(var(--primary-400));
}

/* 4.10 Nhãn xếp loại và điểm */
.grade-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.grade-badge--excellent,
.grade-badge--passed {
    background: var(--app-green-soft);
    color: #047857;
}

.grade-badge--improve {
    background: var(--app-amber-soft);
    color: #b45309;
}

.grade-badge--failed {
    background: var(--app-red-soft);
    color: #be123c;
}

.grade-badge--empty {
    background: var(--app-track);
    color: var(--app-text-muted);
}

.dark .grade-badge--excellent,
.dark .grade-badge--passed { color: #34d399; }
.dark .grade-badge--improve { color: #fbbf24; }
.dark .grade-badge--failed { color: #fb7185; }

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.score-pill--good { background: var(--app-green); }
.score-pill--warning { background: var(--app-amber); }
.score-pill--danger { background: var(--app-red); }

.score-with-grade {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.score-with-grade__value {
    font-size: 1rem;
    font-weight: 700;
}

/* 4.11 Viên nhỏ thống kê theo loại việc */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-text-muted);
    font-size: 0.78rem;
}

.chip__label {
    color: var(--app-text);
    font-weight: 600;
}

.chip__danger {
    color: var(--app-red);
    font-weight: 600;
}

/* 4.12 Dòng mô tả nhỏ dưới bộ lọc, hướng dẫn */
.helper-line {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--app-text);
}

.formula-list strong {
    font-weight: 700;
}

.two-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    align-items: start;
    gap: 1rem;
}

/* 4.13 Ô tiến độ chỉ tiêu trong bảng */
.target-cell {
    min-width: 8.5rem;
}

.target-cell__numbers {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--app-text);
}

.target-cell__unit {
    font-weight: 400;
    color: var(--app-text-muted);
}

.target-cell .progress-track {
    margin-top: 0.3rem;
}

.target-cell__hint {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--app-text-muted);
}

/* ---------------------------------------------------------------------------
 * 5. Điện thoại và máy tính bảng
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .fi-header-heading {
        font-size: 1.3rem;
    }

    .work-progress-card {
        padding: 1rem 1.1rem;
    }

    .work-progress-card__done {
        font-size: 1.6rem;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .metric-card {
        padding: 0.8rem 0.85rem;
    }

    .metric-card__value {
        font-size: 1.25rem;
    }

    .panel-block__header {
        align-items: flex-start;
    }
}

@media print {
    .fi-sidebar,
    .fi-topbar {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
 * 6. Người nhận việc trong Master List (ảnh + tên + chấm trạng thái)
 * ------------------------------------------------------------------------- */
.assignee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 22rem;
    padding: 0.2rem 0;
}

.assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem 0.15rem 0.15rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
}

.assignee-chip {
    max-width: 100%;
}

.assignee-chip__name {
    overflow: hidden;
    max-width: 9.5rem;
    text-overflow: ellipsis;
}

.assignee-chip__avatar {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
}

.assignee-chip__status {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--app-text-soft);
}

.assignee-chip--overdue {
    border-color: rgba(225, 29, 72, 0.45);
    background: var(--app-red-soft);
}

.assignee-chip__status--assigned { background: #94a3b8; }
.assignee-chip__status--in_progress { background: var(--app-amber); }
.assignee-chip__status--submitted { background: var(--app-sky); }
.assignee-chip__status--completed { background: var(--app-green); }
.assignee-chip__status--rejected { background: var(--app-red); }
.assignee-chip__status--cancelled { background: #cbd5e1; }

.assignee-list__more,
.assignee-list__empty {
    align-self: center;
    font-size: 0.75rem;
    color: var(--app-text-muted);
}

.empty-value {
    font-size: 0.8rem;
    color: var(--app-text-soft);
}

/* ---------------------------------------------------------------------------
 * 7. Chỉ tiêu & tiến độ trong trang chi tiết công việc
 * ------------------------------------------------------------------------- */
.target-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.target-overview__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
    color: var(--app-text);
}

.target-overview__facts strong {
    font-weight: 600;
}

.target-overview__expected {
    color: var(--app-text-muted);
}

.target-person-card {
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--app-border);
    border-radius: 0.85rem;
    background: var(--app-surface);
}

.target-person-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.target-person-card__status {
    margin-left: 0.4rem;
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.target-person-card__numbers {
    font-size: 0.95rem;
}

.target-person-card__achieved {
    font-weight: 700;
}

.target-person-card__achieved--good { color: #059669; }
.target-person-card__achieved--behind { color: var(--app-red); }
.target-person-card__achieved--normal { color: rgb(var(--primary-600)); }

.target-person-card__percent {
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

.target-person-card__track {
    position: relative;
    overflow: visible;
    height: 0.6rem;
    margin: 0.65rem 0 0.8rem;
}

.target-person-card__expected-marker {
    position: absolute;
    top: -0.25rem;
    width: 2px;
    height: 1.1rem;
    background: var(--app-text-muted);
}

.status-tag {
    display: inline-flex;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-tag--danger {
    background: var(--app-red-soft);
    color: #be123c;
}

.status-tag--success {
    background: var(--app-green-soft);
    color: #047857;
}

.dark .status-tag--danger { color: #fb7185; }
.dark .status-tag--success { color: #34d399; }

.checkpoint-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.checkpoint-chip {
    min-width: 6.75rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.55rem;
    font-size: 0.74rem;
    line-height: 1.4;
}

.checkpoint-chip__title {
    font-weight: 600;
}

.checkpoint-chip__detail {
    opacity: 0.85;
}

.checkpoint-chip--upcoming { background: var(--app-track); color: var(--app-text-muted); }
.checkpoint-chip--running { background: var(--app-sky-soft); color: #0369a1; }
.checkpoint-chip--awaiting_report { background: var(--app-amber-soft); color: #b45309; }
.checkpoint-chip--reported { background: var(--app-green-soft); color: #047857; }
.checkpoint-chip--reported_late { background: var(--app-amber-soft); color: #b45309; }
.checkpoint-chip--missed { background: var(--app-red-soft); color: #be123c; }

.dark .checkpoint-chip--running { color: #7dd3fc; }
.dark .checkpoint-chip--awaiting_report,
.dark .checkpoint-chip--reported_late { color: #fbbf24; }
.dark .checkpoint-chip--reported { color: #34d399; }
.dark .checkpoint-chip--missed { color: #fb7185; }

/* ---------------------------------------------------------------------------
 * 8. Không gian phòng ban: thẻ thông tin phòng
 * ------------------------------------------------------------------------- */
.department-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem 1.5rem;
}

.department-header__block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.department-header__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

.department-header__value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--app-text);
}

.department-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.8rem;
    font-weight: 500;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.department-link:hover {
    border-color: rgb(var(--primary-400));
    background: var(--app-blue-soft);
}

.department-link--muted {
    color: var(--app-text-muted);
    cursor: default;
}

.department-link--muted:hover {
    border-color: var(--app-border);
    background: var(--app-surface);
}

.department-link svg {
    width: 0.95rem;
    height: 0.95rem;
}

.section-title {
    margin: 0.25rem 0 -0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-text);
}

/* ---------------------------------------------------------------------------
 * 9. Sơ đồ tổ chức
 * ------------------------------------------------------------------------- */
.org-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.org-chart__company {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--app-radius-card);
    background: linear-gradient(135deg, rgb(var(--primary-600)), rgb(var(--primary-800)));
    color: #ffffff;
    box-shadow: var(--app-shadow-card);
}

.org-chart__company-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.org-chart__company-meta {
    font-size: 0.82rem;
    opacity: 0.85;
}

.org-chart__company-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.org-chart__company-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.org-chart__company-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
}

.org-chart__company-stat-label {
    font-size: 0.72rem;
    opacity: 0.85;
}

.org-chart__children {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-left: 1.1rem;
    padding-left: 1.1rem;
    border-left: 2px solid var(--app-border-strong);
}

.org-chart__root-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.org-node {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.org-chart__children > .org-node::before {
    content: "";
    position: absolute;
    top: 1.6rem;
    left: -1.1rem;
    width: 1.1rem;
    border-top: 2px solid var(--app-border-strong);
}

.org-node__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    padding: 0.85rem 1.05rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-card);
}

.org-node__card--inactive {
    opacity: 0.6;
}

.org-node__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 14rem;
}

.org-node__badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.4rem;
    border-radius: 0.7rem;
    background: var(--app-blue-soft);
    color: rgb(var(--primary-600));
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.dark .org-node__badge {
    color: rgb(var(--primary-400));
}

.org-node__name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--app-text);
}

.org-node__manager {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

.org-node__manager img {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
}

.org-node__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.org-node__stat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 4.4rem;
    padding: 0.3rem 0.55rem;
    border-radius: 0.6rem;
    background: var(--app-surface-muted);
}

.org-node__stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-text);
}

.org-node__stat-value--danger {
    color: var(--app-red);
}

.org-node__stat-label {
    font-size: 0.68rem;
    color: var(--app-text-muted);
    white-space: nowrap;
}

.org-node__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .org-chart__children {
        margin-left: 0.4rem;
        padding-left: 0.8rem;
    }

    .org-chart__children > .org-node::before {
        left: -0.8rem;
        width: 0.8rem;
    }

    .org-node__identity {
        min-width: 0;
    }
}

/* ---------------------------------------------------------------------------
 * 10. Kho tài khoản: hộp thoại thông tin đăng nhập, ô mật khẩu che, nhãn quyền
 * ------------------------------------------------------------------------- */
.asset-secrets {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.asset-secrets__empty {
    padding: 1rem;
    border-radius: var(--app-radius-control);
    background: var(--app-surface-muted);
    color: var(--app-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.asset-secrets__warning {
    padding: 0.65rem 0.85rem;
    border-radius: var(--app-radius-control);
    background: var(--app-red-soft);
    color: var(--app-red);
    font-size: 0.82rem;
    font-weight: 600;
}

.asset-secrets__list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-control);
    overflow: hidden;
}

.asset-secrets__row {
    display: grid;
    grid-template-columns: minmax(9rem, 34%) 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--app-border);
}

.asset-secrets__row:first-child {
    border-top: none;
}

.asset-secrets__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--app-text-muted);
}

.asset-secrets__value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.asset-secrets__text {
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--app-text);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.asset-secrets__masked {
    letter-spacing: 0.12em;
    color: var(--app-text-soft);
}

.asset-secrets__link {
    color: var(--app-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.asset-secrets__buttons {
    display: inline-flex;
    flex-shrink: 0;
    gap: 0.35rem;
}

.asset-secrets__button {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--app-border-strong);
    border-radius: 0.5rem;
    background: var(--app-surface);
    color: var(--app-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.asset-secrets__button:hover {
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.asset-secrets__button--primary {
    border-color: transparent;
    background: var(--app-blue-soft);
    color: var(--app-blue);
}

.asset-secrets__button--primary:hover {
    background: var(--app-blue);
    color: #ffffff;
}

.asset-secrets__footnote {
    font-size: 0.75rem;
    color: var(--app-text-soft);
}

/* Hướng dẫn trên trang nhập file */
.import-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.75rem;
}

.import-guide__step {
    display: flex;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-control);
    background: var(--app-surface);
}

.import-guide__number {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--app-blue-soft);
    color: var(--app-blue);
    font-size: 0.8rem;
    font-weight: 700;
}

.import-guide__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-text);
}

.import-guide__text {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

@media (max-width: 640px) {
    .asset-secrets__row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}
