/*
 * Workfast HR — lớp trình bày trang quản trị (CEO góp ý 28/09: thêm màu, điểm nhấn, khung, bảng dễ theo dõi).
 * Theo bản mẫu đã duyệt: xanh lá #1E6B47 (NLĐ/văn phòng), vàng cam #B45309 (đối tác), nền kem #F6F4EF, Be Vietnam Pro.
 * CSS thường (không qua build) nạp bằng render hook trong AdminPanelProvider; bám theo lớp fi-* của Filament.
 */
:root {
    --wf-green: #1E6B47;
    --wf-green-soft: #E8F2EC;
    --wf-orange: #B45309;
    --wf-cream: #F6F4EF;
    --wf-line: #E4E0D6;
    --wf-ink: #1F2A24;
    --wf-muted: #5B6560;
}

/* ── Nền + khung chung ─────────────────────────────────────────────── */
.fi-body { background: var(--wf-cream); color: var(--wf-ink); }
.fi-topbar > nav, .fi-topbar { background: #fff; border-bottom: 1px solid var(--wf-line); box-shadow: none; }
.fi-sidebar { background: #fff; border-right: 1px solid var(--wf-line); }
.fi-sidebar-item.fi-active > a, .fi-sidebar-item-active > a {
    background: var(--wf-green-soft);
    box-shadow: inset 3px 0 0 var(--wf-green);
}
.fi-sidebar-item.fi-active > a *, .fi-sidebar-item-active > a * { color: var(--wf-green); font-weight: 600; }

.fi-header-heading, .fi-page-header-heading { color: var(--wf-ink); letter-spacing: -0.01em; }

/* Khung nội dung (section, thẻ thông tin) */
.fi-section {
    background: #fff;
    border: 1px solid var(--wf-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(31, 42, 36, .04);
}
.fi-section-header-heading {
    border-left: 3px solid var(--wf-green);
    padding-left: 10px;
    color: var(--wf-ink);
}

/* ── Bảng ──────────────────────────────────────────────────────────── */
.fi-ta-ctn {
    background: #fff;
    border: 1px solid var(--wf-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(31, 42, 36, .04);
    overflow: hidden;
}
.fi-ta-header-cell {
    background: #F3F6F1;
    color: var(--wf-green);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--wf-line);
}
.fi-ta-header-cell * { color: inherit; }
.fi-ta-row:nth-child(even) { background: #FBFAF7; }
.fi-ta-row:hover { background: #EEF6F1; }
.fi-ta-cell { border-bottom: 1px solid #F0EDE6; }

/* ── Thẻ số liệu bấm-để-lọc (resources/views/filament/components/stat-cards.blade.php) ── */
.wf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}
.wf-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    background: #fff;
    border: 1px solid var(--wf-line);
    border-top: 4px solid var(--wf-c, var(--wf-green));
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
    box-shadow: 0 1px 2px rgba(31, 42, 36, .04);
}
.wf-stat:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31, 42, 36, .08); }
.wf-stat:focus-visible { outline: 2px solid var(--wf-c); outline-offset: 2px; }
.wf-stat.is-active {
    background: var(--wf-bg, var(--wf-green-soft));
    border-color: var(--wf-c);
    box-shadow: 0 0 0 1px var(--wf-c) inset, 0 4px 12px rgba(31, 42, 36, .08);
}
.wf-stat-label { font-size: 13px; font-weight: 600; color: var(--wf-muted); }
.wf-stat.is-active .wf-stat-label { color: var(--wf-c); }
.wf-stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--wf-c, var(--wf-ink)); font-variant-numeric: tabular-nums; }
.wf-stat-sub { font-size: 12px; color: var(--wf-muted); font-variant-numeric: tabular-nums; }

/* Điện thoại: thẻ số liệu thành một dải vuốt ngang gọn (trước đây chiếm trọn màn hình đầu) */
@media (max-width: 640px) {
    .wf-stats {
        display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
        margin: 0 -16px 2px; padding: 2px 16px 6px; scrollbar-width: none;
    }
    .wf-stats::-webkit-scrollbar { display: none; }
    .wf-stat { flex: 0 0 auto; min-width: 104px; max-width: 150px; padding: 7px 10px; border-top-width: 3px; scroll-snap-align: start; }
    .wf-stat-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .wf-stat-value { font-size: 18px; }
    .wf-stat-sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .fi-header { gap: 10px; }
    .fi-header .fi-ac { flex-wrap: wrap; gap: 6px; }
    .fi-header .fi-btn { padding: 6px 10px; font-size: 13px; }
}

/* Điện thoại — dòng bảng dạng thẻ gọn: nhãn nhỏ bên trái, giá trị bên phải; ranh giới giữa các thẻ rõ, giữa các ô thì không */
@media (max-width: 639px) {
    .fi-ta-table-stacked-on-mobile > tbody > tr { padding: 8px 0; border-bottom: 6px solid var(--wf-cream); }
    .fi-ta-table-stacked-on-mobile > tbody > tr:nth-child(even) { background: #fff; }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td { border-bottom: 0; }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td:has(> .fi-ta-cell-label) {
        display: grid; grid-template-columns: minmax(84px, 34%) 1fr; column-gap: 10px; align-items: baseline; padding: 2px 16px;
    }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td > .fi-ta-cell-label {
        padding-top: 0; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--wf-muted);
    }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td > .fi-ta-cell-content { font-size: 14px; }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td .fi-ta-text { padding-top: 0; padding-bottom: 0; }
    .fi-ta-table-stacked-on-mobile > tbody > tr > td:has(.fi-ta-actions) { padding: 6px 16px 2px; }
}

/* Bảng nhiều cột số (kỳ lương, lệnh ứng): ô hẹp hơn để vừa laptop 1280px, không phải kéo ngang tìm nút / cột doanh thu */
@media (min-width: 640px) {
    :is(.fi-resource-ky-luong, .fi-resource-ung-luong) .fi-ta-text,
    :is(.fi-resource-ky-luong, .fi-resource-ung-luong) .fi-ta-header-cell { padding-inline: 6px; }
    :is(.fi-resource-ky-luong, .fi-resource-ung-luong) .fi-ta-header-cell:first-child,
    :is(.fi-resource-ky-luong, .fi-resource-ung-luong) .fi-ta-cell:first-child .fi-ta-text { padding-inline-start: 16px; }
}

/* Dòng tóm tắt (tổng tháng / tổng chung): nền đậm + chữ đậm, tách khỏi các dòng kỳ */
.fi-ta-summary-row, .fi-ta-summary-header-row { background: #EEF5EF; }
.fi-ta-summary-row td, .fi-ta-summary-header-row td, .fi-ta-summary-row .fi-ta-text, .fi-ta-summary-row-heading-cell { font-weight: 700; color: #1F2A24; }
.fi-ta-summary-row { border-top: 2px solid #9BC4A5; border-bottom: 2px solid #9BC4A5; }
.fi-ta-group-header { background: #F6F3EC; font-weight: 700; }

/* Ứng tuyển dạng thẻ 4 khối như hệ cũ (pipeline.html .pl-card): ứng viên | thông tin | ghi chú | giai đoạn + nút */
.fi-resource-ung-tuyen .wf-pl { align-items: flex-start !important; }
.fi-resource-ung-tuyen .wf-pl > div { min-width: 0; }
@media (min-width: 768px) {
    .fi-resource-ung-tuyen .wf-pl > div:nth-child(1) { flex: 0 0 24%; }
    .fi-resource-ung-tuyen .wf-pl > div:nth-child(2) { flex: 0 0 31%; }
    .fi-resource-ung-tuyen .wf-pl > div:nth-child(3) { flex: 1 1 auto; }
    .fi-resource-ung-tuyen .wf-pl > div:nth-child(4) { flex: 0 0 150px; }
}
.fi-resource-ung-tuyen .wf-pl-c2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.fi-resource-ung-tuyen .wf-pl-c2 .fi-ta-text { padding: 0; }
.fi-resource-ung-tuyen .wf-pl-k { display: block; font-size: 10.5px; line-height: 14px; text-transform: uppercase; letter-spacing: .02em; color: var(--wf-muted, #8A928D); }
.fi-resource-ung-tuyen .wf-pl-v { font-size: 13px; color: #1F2A24; }
.fi-resource-ung-tuyen .wf-pl-c3 { font-style: italic; font-size: 13px; color: #3F4A44; max-height: 7em; overflow: hidden; }
.fi-resource-ung-tuyen .wf-pl-c3:has(.fi-ta-placeholder) { color: #A5ADA8; }
/* Cụm nút xếp gọn bên phải (như khối 4 hệ cũ), phần thẻ chiếm phần còn lại */
@media (min-width: 640px) {
    .fi-resource-ung-tuyen .fi-ta-record-content-ctn > div:first-child { flex: 1 1 auto; min-width: 0; }
    .fi-resource-ung-tuyen .fi-ta-record-content-ctn > .fi-ta-actions { flex: 0 0 auto; align-self: flex-start; justify-content: end; }
}
/* Ô cố định cho từng nút: hàng 1 = ✏️ · 📋 · ⋯ luôn cùng vị trí (thiếu nút thì để trống ô), hàng 2 = nút chữ (Nhận lead / Nhận về / Khôi phục) */
.fi-resource-ung-tuyen .fi-ta-record-content-ctn > .fi-ta-actions { display: grid !important; grid-template-columns: repeat(3, 40px); gap: 6px; align-content: start; justify-items: center; }
.fi-resource-ung-tuyen .fi-ta-actions .wf-pl-s1 { grid-column: 1; grid-row: 1; }
.fi-resource-ung-tuyen .fi-ta-actions .wf-pl-s2 { grid-column: 2; grid-row: 1; }
.fi-resource-ung-tuyen .fi-ta-actions > .fi-dropdown:has(.wf-pl-s3) { grid-column: 3; grid-row: 1; }
.fi-resource-ung-tuyen .fi-ta-actions .wf-pl-wide { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: center; }

/* Hai cột Hồ sơ NLĐ / Thẻ ứng viên (rà giao diện 10/10/2026): máy tính 2 cột, điện thoại xếp 1 cột — trước min-width cố định làm tràn ngang ở 390px */
.wf-main { flex: 1 1 560px; min-width: 0; }
.wf-main-sm { flex-basis: 420px; }
.wf-side { flex: 0 0 360px; max-width: 100%; min-width: 0; }
.wf-side-400 { flex-basis: 400px; }
.wf-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 1023px) {
    .wf-side, .wf-side-400 { flex: 1 1 100%; }
}
@media (max-width: 767px) {
    .wf-emp-row { grid-template-columns: 32px 1fr 1fr !important; row-gap: 4px !important; }
}
