/* HRM 32BitZ — hồ sơ nhân sự và bảng lương.
   Cùng bộ khung với Help Desk và Transport (header dính, thẻ trắng, bảng gọn) nhưng nền sáng và
   tông tím than: đây là màn hình tra cứu dữ liệu cá nhân, không phải bảng công việc. */

:root {
    --hr-bg: #f2f3f8;
    --hr-header: #221c4a;
    --hr-header-2: #35286b;
    --hr-accent: #5b4bd6;
    --hr-accent-dark: #4a3cc0;
    --hr-ink: #1d2233;
    --hr-muted: #6a7085;
    --hr-line: #e1e4ed;
    --hr-card: #ffffff;
    --hr-ok: #1f9d55;
    --hr-warn: #b26a00;
    --hr-danger: #d93a3a;
    --hr-radius: 12px;
    --hr-shadow: 0 1px 2px rgba(29, 34, 51, .14), 0 0 0 1px rgba(29, 34, 51, .04);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font: 15px/1.6 "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    color: var(--hr-ink);
    background: var(--hr-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--hr-accent-dark); }

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ header */

.hr-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 11px 24px;
    background: linear-gradient(120deg, var(--hr-header), var(--hr-header-2));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 2px 10px rgba(29, 22, 66, .25);
}

.hr-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
}

/* Logo có viền đen nên luôn đặt trên nền sáng. */
.hr-logo { background: #fff; border-radius: 8px; padding: 5px 9px; display: grid; place-items: center; }

.hr-logo img { display: block; height: 24px; width: auto; }

.hr-nav { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: auto; }

.hr-nav a, .hr-nav button {
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    padding: 7px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.hr-nav a:hover, .hr-nav button:hover { background: rgba(255, 255, 255, .18); }

.hr-nav a.is-active { background: #fff; color: var(--hr-header); font-weight: 600; }

.hr-nav a.hr-back { border: 1px solid rgba(255, 255, 255, .35); font-size: 13px; margin-left: 8px; }

.hr-nav form { margin: 0; }

.hr-nav button { background: rgba(255, 255, 255, .16); }

.hr-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .9); }

/* ------------------------------------------------------------------ khung trang */

main { max-width: 1140px; margin: 0 auto; padding: 24px 22px 56px; }

.hr-page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.hr-page-head h1 { margin: 0; font-size: 23px; }

.hr-page-head .hr-sub { color: var(--hr-muted); font-size: 14px; }

.hr-page-head .hr-spacer { margin-left: auto; }

.hr-flash {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    border-left: 4px solid var(--hr-ok);
    box-shadow: var(--hr-shadow);
}

.hr-flash.is-error { border-left-color: var(--hr-danger); }

/* ------------------------------------------------------------------ thẻ */

.hr-card {
    background: var(--hr-card);
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow);
    padding: 18px 20px;
    margin: 0 0 18px;
}

.hr-card > h2 { margin: 0 0 4px; font-size: 16px; }

.hr-card > .hr-hint { margin: 0 0 14px; color: var(--hr-muted); font-size: 13.5px; line-height: 1.55; }

.hr-card.is-flush { padding: 0; overflow: hidden; }

/* ------------------------------------------------------------------ nút */

.hr-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    background: var(--hr-accent);
    color: #fff;
    padding: 9px 15px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.hr-btn:hover { background: var(--hr-accent-dark); }

.hr-btn.is-light { background: #eceef5; color: var(--hr-ink); }

.hr-btn.is-light:hover { background: #e0e3ee; }

.hr-btn.is-ok { background: var(--hr-ok); }

.hr-btn.is-danger { background: var(--hr-danger); }

.hr-btn.is-small { padding: 6px 11px; font-size: 13px; }

.hr-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------------ biểu mẫu */

.hr-form { display: grid; gap: 14px; }

.hr-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hr-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.hr-form label, .hr-field {
    display: grid;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--hr-muted);
}

.hr-form input, .hr-form select, .hr-form textarea {
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    color: var(--hr-ink);
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--hr-line);
    border-radius: 8px;
    background: #fbfcfe;
}

.hr-form textarea { min-height: 78px; resize: vertical; }

.hr-form input:focus, .hr-form select:focus, .hr-form textarea:focus {
    outline: 2px solid rgba(91, 75, 214, .3);
    border-color: var(--hr-accent);
}

.hr-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.hr-actions .hr-spacer { margin-left: auto; }

.hr-money { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ bảng */

.hr-scroll { overflow-x: auto; }

.hr-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.hr-table th, .hr-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--hr-line); }

.hr-table thead th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--hr-muted);
    background: #f7f8fc;
    white-space: nowrap;
}

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

.hr-table tbody tr:hover { background: #fafaff; }

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

.hr-name { font-weight: 600; }

.hr-sub-text { font-size: 12.5px; color: var(--hr-muted); }

/* ------------------------------------------------------------------ nhãn trạng thái */

.hr-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    background: #eceef5;
    color: var(--hr-muted);
    white-space: nowrap;
}

.hr-badge.is-issued { background: #e6f6ec; color: #1a6b41; }

.hr-badge.is-draft { background: #fff2e0; color: var(--hr-warn); }

.hr-badge.is-missing { background: #f2f3f8; color: #8b90a3; }

.hr-badge.is-off { background: #fdeaea; color: #a72020; }

/* ------------------------------------------------------------------ hồ sơ chỉ đọc */

.hr-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }

.hr-profile > div {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hr-line);
}

.hr-profile dt, .hr-profile .hr-key {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--hr-muted);
}

.hr-profile dd, .hr-profile .hr-val { margin: 0; overflow-wrap: anywhere; }

.hr-profile .hr-val:empty::after { content: "—"; color: #aeb3c4; }

/* ------------------------------------------------------------------ phiếu lương */

.hr-payslip-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--hr-line);
    margin-bottom: 16px;
}

.hr-payslip-head h2 { margin: 0 0 2px; font-size: 19px; }

.hr-lines { width: 100%; border-collapse: collapse; font-size: 14px; }

.hr-lines th, .hr-lines td { padding: 8px 0; border-bottom: 1px solid var(--hr-line); }

.hr-lines th { text-align: left; font-weight: 400; color: var(--hr-ink); }

.hr-lines td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.hr-lines .hr-group th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--hr-muted);
    font-weight: 700;
    padding-top: 16px;
    border-bottom: 0;
}

.hr-lines .hr-total th, .hr-lines .hr-total td { font-weight: 700; border-top: 1px solid var(--hr-line); }

.hr-lines .hr-net th, .hr-lines .hr-net td {
    font-size: 17px;
    font-weight: 700;
    color: var(--hr-accent-dark);
    border-bottom: 0;
    padding-top: 14px;
}

/* ------------------------------------------------------------------ hộp thoại */

.hr-dialog {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(24, 20, 56, .55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
    overflow-y: auto;
}

.hr-dialog-panel {
    background: #fff;
    border-radius: 14px;
    width: min(720px, 100%);
    padding: 20px 22px 22px;
    box-shadow: 0 18px 50px rgba(24, 20, 56, .35);
}

.hr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.hr-dialog-head h2 { margin: 0; font-size: 17px; }

.hr-close {
    border: 0;
    background: #eceef5;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* ------------------------------------------------------------------ đăng nhập */

.hr-login-page {
    background:
        radial-gradient(1000px 560px at 12% -10%, rgba(255, 255, 255, .14), transparent 60%),
        linear-gradient(160deg, #2b2160, var(--hr-header) 55%, #1a1440);
}

.hr-login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 28px 20px; }

.hr-login-card {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(16, 12, 40, .45);
}

.hr-login-brand {
    background: linear-gradient(165deg, #3a2c78, #241c53);
    color: #fff;
    padding: 34px 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hr-logo-plate {
    background: #fff;
    border-radius: 12px;
    padding: 13px 17px;
    align-self: flex-start;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.hr-logo-plate img { display: block; height: 72px; width: auto; }

.hr-login-brand h2 { margin: 8px 0 0; font-size: 26px; }

.hr-login-brand p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 14px; line-height: 1.55; }

.hr-login-features { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }

.hr-login-features li {
    position: relative;
    padding-left: 25px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .92);
}

.hr-login-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -1px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #9ae6b4;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.hr-login-foot { margin-top: auto; padding-top: 18px; font-size: 12px; color: rgba(255, 255, 255, .55); }

.hr-login-form { padding: 38px 34px 32px; display: flex; flex-direction: column; justify-content: center; }

.hr-login-form h1 { margin: 0 0 4px; font-size: 23px; }

.hr-login-lead { margin: 0 0 20px; color: var(--hr-muted); font-size: 14px; }

.hr-login-form .hr-btn { width: 100%; justify-content: center; margin-top: 6px; padding: 11px 14px; }

.hr-login-note {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--hr-line);
    color: var(--hr-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.hr-error {
    background: #fdeaea;
    color: #a72020;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    margin-bottom: 14px;
}

/* ------------------------------------------------------------------ in phiếu lương */

@media print {
    .hr-header, .hr-page-head .hr-btn, .hr-noprint { display: none !important; }
    body { background: #fff; }
    main { padding: 0; max-width: none; }
    .hr-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ------------------------------------------------------------------ điện thoại */

@media (max-width: 760px) {
    .hr-header { padding: 10px 14px; gap: 10px; }
    .hr-nav { width: 100%; margin-left: 0; }
    main { padding: 16px 13px 40px; }
    .hr-grid-2, .hr-grid-3, .hr-profile { grid-template-columns: 1fr; }
    .hr-profile > div { grid-template-columns: 1fr; gap: 2px; }
    .hr-login-card { grid-template-columns: 1fr; width: min(430px, 100%); }
    .hr-login-brand { padding: 24px 24px 22px; }
    .hr-logo-plate { align-self: center; padding: 11px 15px; }
    .hr-logo-plate img { height: 58px; }
    .hr-login-brand h2, .hr-login-brand p { text-align: center; }
    .hr-login-features, .hr-login-foot { display: none; }
    .hr-login-form { padding: 26px 22px 24px; }
}
