/* Hành chính — requests: CSS riêng của mục này, nạp ngay sau hanh-chinh.css và hanh-chinh-assets.css, hanh-chinh-insurance.css, hanh-chinh-payroll.css.
   Tách từ hanh-chinh.css ngày 2026-10-10 (tools/crm-visual/extract-module.cjs); thứ tự cascade đã kiểm. */

.approval-inbox-card {
        margin-bottom:16px;
        border:1px solid #F0D0C8;
        background:linear-gradient(135deg, #fffafa 0%, #fff7ef 100%);
    }
    .approval-inbox-head {
        display:flex;
        align-items:flex-start;
        justify-content:space-between;
        gap:14px;
        margin-bottom:14px;
    }
    .approval-inbox-title {
        margin:0 0 4px;
        font-family:'Cormorant Garamond', serif;
        font-size:25px;
        color:var(--charcoal);
    }
    .approval-inbox-note {
        margin:0;
        color:#000;
        font-size:13px;
        line-height:1.55;
    }
    .approval-inbox-summary {
        flex-wrap:wrap;
    }
    .approval-inbox-list {
        display:grid;
        gap:10px;
    }
    .approval-inbox-empty {
        padding:16px;
        border-radius:16px;
        background:#fff;
        border:1px dashed #EADCCA;
        color:#000;
        font-size:13px;
        text-align:center;
    }

    /* ===== DANH SÁCH ĐƠN ===== */
    .req-list { display: flex; flex-direction: column; gap: 12px; }
    .req-card.clickable { cursor: pointer; }
    .req-card .req-info { flex: 1; min-width: 0; }
    .req-card .req-status { flex-shrink: 0; }

/* ============================================================================
   BANG DUYET — THE SO, BO LOC, THE NGANG (04/09/2026)
   ============================================================================ */
.approval-inbox-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.approval-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid #EAE1D5;
    border-radius: 16px;
    background: #FFFFFF;
}

.approval-kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; color: #261E16; }
.approval-kpi-label { font-size: 12px; color: #827464; }
.approval-kpi[data-tone="pending"] { background: #FFF5E6; border-color: #F5D9B3; }
.approval-kpi[data-tone="pending"] .approval-kpi-value { color: #A05A12; }
.approval-kpi[data-tone="attendance"] { background: #EDF7F1; border-color: #C4E8D1; }
.approval-kpi[data-tone="attendance"] .approval-kpi-value { color: #226842; }

.approval-filter-chip span { color: #918170; font-weight: 700; }
.approval-filter-chip.active span { color: #A05A12; }

@media (max-width: 720px) {


/* Man hinh hep: the xep doc, nut trai het be ngang cho de bam bang ngon tay. */

    .approval-card { flex-wrap: wrap; }
    .approval-card-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================================
   LUOI CHON LOAI DON (04/09/2026)
   ============================================================================
   Mau lay theo bo ma Chu CRM cung cap: nen #FAF8F5, vien #E7DFD4, chon thi
   vien #C27A34 nen #FDF7EF chu #8D5017. Giu nguyen he am/caramel cua trang.
   Dung `grid-template-columns: repeat(auto-fit, minmax(...))` de tu xep lai theo
   be ngang — khong ghim so cot theo diem gay, vi trang nay con nhung trong nhieu
   khung rong hep khac nhau. */
.req-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.req-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 4px;
    padding: 14px 10px;
    border: 2px solid #E7DFD4;
    border-radius: 16px;
    background: #FAF8F5;
    color: #4F4337;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}

.req-type-card:hover { border-color: #D6C4B0; }
.req-type-card:active { transform: scale(.98); }

.req-type-card .material-icons { font-size: 26px; }
.req-type-card-name { font-weight: 700; font-size: 13px; line-height: 1.35; }
.req-type-card-badge { font-size: 10.5px; color: #918170; }
.req-type-card.is-selected .req-type-card-badge { color: #A05A12; }

/* The Tang ca di duong khac: bam vao mo luong chuyen biet chu khong dien form nay.
   Vien dut de nguoi dung thay ngay la no khong cung mot nhom voi sau the kia. */
.req-type-card.is-separate-flow { border-style: dashed; }

/* TO DON hien ra sau khi chon loai: tieu de + Kinh gui + thong tin nhan su tu dien.
   Vien trai mau caramel de nhin ra ngay day la "to don", khong lan voi cac o nhap ben duoi. */
.req-don-preview {
    margin: 16px 0 4px;
    padding: 18px 20px;
    border: 1px solid #EAE1D5;
    border-left: 3px solid #C27A34;
    border-radius: 16px;
    background: #FCFAF7;
}

.req-don-tieude {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .5px;
    text-align: center;
    color: #261E16;
    margin-bottom: 14px;
}

.req-don-preview .attendance-document-grid { margin-top: 12px; }

/* ============================================================================
   HOP DONG VA QUYET DINH (26/10/2026, bo cuc lai lan 3 theo Chu CRM)
   ============================================================================
   Loai van ban len dau, nhan su la o tim kiem goi y, thanh van ban dinh khi cuon, form chia
   the theo nhom. Lop rieng .hcd-* (khong dung .form-group / .btn-sign chung: nhan viet HOA,
   nut 15px) de khu vuc nay gon, nhat quan voi tong dong / kem cua trang Hanh chinh. */
.hcd-card, .hcd-pdf-modal {
    --hcd-ink: #1D1A16;
    --hcd-sub: #6B5B49;
    --hcd-line: #E8DFD2;
    --hcd-line-strong: #D9CBB8;
    --hcd-bronze: #AE7C41;
    --hcd-bronze-dark: #8A5F2C;
    --hcd-bronze-soft: #FBF5EC;
    --hcd-cream: #FFFDF9;
    --hcd-warn: #B7791F;
    --hcd-warn-soft: #FFF8EA;
    --hcd-ok: #2F7A4F;
    --hcd-radius: 12px;
    font-family: var(--hc-font, "Plus Jakarta Sans", system-ui, sans-serif);
}
.hcd-card {
    padding: 24px;
    font-family: var(--hc-font, "Plus Jakarta Sans", system-ui, sans-serif);
    color: var(--hcd-ink);
}
.hcd-card .material-icons { font-size: 18px; line-height: 1; }

.hcd-label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--hcd-sub);
}
.hcd-req { color: #B4532A; }
.hcd-help { margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--hcd-sub); }

/* Loai van ban */
.hcd-block { margin-bottom: 18px; }
.hcd-types {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.hcd-type {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid var(--hcd-line);
    border-radius: var(--hcd-radius);
    background: #fff;
    color: var(--hcd-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.hcd-type:hover { border-color: var(--hcd-line-strong); background: var(--hcd-cream); }
.hcd-type:focus-visible { outline: 2px solid var(--hcd-bronze); outline-offset: 2px; }
.hcd-type.is-selected {
    border-color: var(--hcd-bronze);
    background: var(--hcd-bronze-soft);
    box-shadow: inset 0 0 0 1px var(--hcd-bronze);
}
.hcd-type-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 9px;
    background: #F4EEE5;
    color: var(--hcd-bronze-dark);
}
.hcd-type.is-selected .hcd-type-icon { background: var(--hcd-bronze); color: #fff; }
.hcd-type-text { display: grid; gap: 2px; min-width: 0; }
.hcd-type-text b { font-size: 13px; font-weight: 700; line-height: 1.3; }
.hcd-type-text small { font-size: 11px; font-weight: 600; color: var(--hcd-sub); letter-spacing: .03em; }

/* Thiet lap: nhan su + nguon */
.hcd-setup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--hcd-line);
    border-radius: var(--hcd-radius);
    background: var(--hcd-cream);
}
.hcd-setup-field { min-width: 0; }

.hcd-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid var(--hcd-line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--hcd-ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.hcd-input:focus { outline: none; border-color: var(--hcd-bronze); box-shadow: 0 0 0 3px rgba(174, 124, 65, .18); }
.hcd-input:disabled { background: #F6F2EC; color: var(--hcd-sub); }
select.hcd-input { padding-right: 30px; }
.hcd-input.is-empty { border-color: #E9C98F; background: var(--hcd-warn-soft); }

.hcd-combo { position: relative; }
.hcd-combo-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--hcd-sub); pointer-events: none; }
.hcd-combo-input { padding-left: 36px; }
.hcd-combo-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--hcd-line);
    border-radius: var(--hcd-radius);
    background: #fff;
    box-shadow: 0 16px 40px rgba(60, 40, 18, .16);
}
.hcd-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
}
.hcd-option.is-active, .hcd-option:hover { background: var(--hcd-bronze-soft); }
.hcd-option-more, .hcd-option-empty { padding: 10px; font-size: 12px; color: var(--hcd-sub); }

.hcd-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    height: 38px;
    border-radius: 50%;
    background: #EFE4D4;
    color: var(--hcd-bronze-dark);
    font-size: 13px;
    font-weight: 800;
}
.hcd-avatar--sm { flex-basis: 32px; height: 32px; font-size: 12px; }
.hcd-person-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.hcd-person-text b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcd-person-text small { font-size: 12px; color: var(--hcd-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcd-person-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 6px 6px 6px 8px;
    border: 1px solid var(--hcd-line-strong);
    border-radius: 11px;
    background: #fff;
}
.hcd-status {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #F1ECE5;
    color: var(--hcd-sub);
}
.hcd-status--resigned { background: #F6E7E3; color: #9A3C24; }
.hcd-status--pending_resignation { background: var(--hcd-warn-soft); color: var(--hcd-warn); }

/* Nut */
.hcd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.hcd-btn:focus-visible { outline: 2px solid var(--hcd-bronze); outline-offset: 2px; }
.hcd-btn:disabled { opacity: .55; cursor: progress; }
.hcd-btn--primary { background: var(--hcd-bronze); color: #fff; }
.hcd-btn--primary:hover:not(:disabled) { background: var(--hcd-bronze-dark); }
.hcd-btn--secondary { background: #fff; border-color: var(--hcd-line-strong); color: var(--hcd-ink); }
.hcd-btn--secondary:hover:not(:disabled) { border-color: var(--hcd-bronze); color: var(--hcd-bronze-dark); }
.hcd-btn--ghost { background: transparent; color: var(--hcd-sub); }
.hcd-btn--ghost:hover:not(:disabled) { background: #F4EEE5; color: var(--hcd-ink); }
.hcd-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.hcd-btn--link { height: auto; padding: 6px 0; margin-top: 8px; background: none; color: var(--hcd-bronze-dark); }
.hcd-btn--link:hover { text-decoration: underline; }
.hcd-icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hcd-sub);
    cursor: pointer;
}
.hcd-icon-btn:hover { background: #F6E7E3; color: #9A3C24; }

/* Thanh van ban (dinh khi cuon) */
.hcd-docbar {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--hcd-line);
    border-radius: var(--hcd-radius);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 8px 22px rgba(60, 40, 18, .07);
}
.hcd-docbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hcd-docbar-title > span:last-child { display: grid; gap: 2px; min-width: 0; }
.hcd-docbar-title b { font-size: 15px; font-weight: 800; }
.hcd-docbar-title small { font-size: 12px; color: var(--hcd-sub); }
.hcd-docbar-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--hcd-bronze-soft);
    color: var(--hcd-bronze-dark);
}
.hcd-docbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hcd-blank-count { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--hcd-line-strong); font-weight: 700; }
.hcd-blank-count.is-warn { color: var(--hcd-warn); }
.hcd-blank-count.is-ok { color: var(--hcd-ok); }

/* Form */
.hcd-form { display: grid; gap: 14px; }
.hcd-section {
    padding: 16px 18px 6px;
    border: 1px solid var(--hcd-line);
    border-radius: var(--hcd-radius);
    background: #fff;
}
.hcd-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 800;
    color: var(--hcd-ink);
}
.hcd-section h4 .material-icons { color: var(--hcd-bronze); }
.hcd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 14px;
}
.hcd-field { min-width: 0; margin-bottom: 14px; }
.hcd-field--wide { grid-column: span 2; }
.hcd-field--full { grid-column: 1 / -1; }
.hcd-field > label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--hcd-sub); }
.hcd-label-note { font-weight: 500; color: #9A8B79; }
.hcd-affix { position: relative; }
.hcd-affix .hcd-input { padding-right: 48px; text-align: right; }
.hcd-affix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--hcd-sub); pointer-events: none; }

.hcd-allowances { display: grid; gap: 8px; }
.hcd-allowance-head, .hcd-allowance-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: center;
}
.hcd-allowance-head span { font-size: 11px; font-weight: 700; color: #9A8B79; }

.hcd-footnote {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #F8F4EE;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--hcd-sub);
}
.hcd-footnote .material-icons { color: var(--hcd-bronze); }

/* Trang thai trong */
.hcd-emptystate {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 40px 16px;
    border: 1px dashed var(--hcd-line-strong);
    border-radius: var(--hcd-radius);
    text-align: center;
    color: var(--hcd-sub);
}
.hcd-emptystate-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--hcd-bronze-soft);
    color: var(--hcd-bronze);
}
.hcd-emptystate-icon .material-icons { font-size: 24px; }
.hcd-emptystate b { font-size: 15px; color: var(--hcd-ink); }
.hcd-emptystate p { margin: 0; max-width: 420px; font-size: 13px; line-height: 1.5; }

@media (max-width: 1100px) {
    .hcd-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hcd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .hcd-card { padding: 16px; }
    /* Dien thoai: mot hang vuot ngang thay vi 3 hang the. */
    .hcd-types { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .hcd-type { flex: 0 0 172px; scroll-snap-align: start; }
    .hcd-setup { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
    .hcd-grid { grid-template-columns: 1fr; }
    .hcd-field--wide { grid-column: auto; }
    .hcd-docbar-actions { width: 100%; }
    .hcd-docbar-actions .hcd-btn { flex: 1; }
    .hcd-docbar-actions .hcd-btn--ghost { flex: 0 0 auto; }
    .hcd-section { padding: 14px 14px 4px; }
}

/* Khung xem PDF */
.hcd-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(31, 25, 18, .55);
}
.hcd-pdf-modal.is-open { display: flex; }
.hcd-pdf-box {
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    height: min(92vh, 1200px);
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.hcd-pdf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid #EAE1D5;
}
.hcd-pdf-head b { color: #1D1A16; font-size: 14px; overflow-wrap: anywhere; }
.hcd-pdf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hcd-pdf-body { position: relative; flex: 1; min-height: 0; background: #525659; }
.hcd-pdf-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #525659; }
.hcd-pdf-loading { padding: 40px 16px; text-align: center; color: #fff; }

@media (max-width: 640px) {
    .hcd-pdf-modal { padding: 0; }
    .hcd-pdf-box { height: 100%; border-radius: 0; }
}
