﻿
/* ================= VARIABLES (Đã thêm tiền tố --hrm-) ================= */
:root {
    --hrm-bg-body: #f3f4f6;
    --hrm-bg-white: #ffffff;
    --hrm-bg-hover: #f9fafb;
    --hrm-text-light: #9ca3af;
    --hrm-text-muted: #6b7280;
    --hrm-text-normal: #4b5563;
    --hrm-text-dark: #374151;
    --hrm-text-bold: #1f2937;
    --hrm-border-light: #f3f4f6;
    --hrm-border-normal: #e5e7eb;
    --hrm-border-dark: #d1d5db;
    --hrm-primary-blue: #3b82f6;
    --hrm-danger-red: #ef4444;
    --hrm-radius-sm: 4px;
    --hrm-radius-md: 8px;
    --hrm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ================= BASE WRAPPER ================= */
/* Giới hạn ảnh hưởng của reset css chỉ nằm trong khối hrm-db-wrapper */
.dashboard-main-content {
    overflow-y: auto;
    height: calc(100vh - 100px);
}

.hrm-db-wrapper {
    background-color: var(--hrm-bg-body);
    color: var(--hrm-text-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

    .hrm-db-wrapper * {
        box-sizing: border-box;
    }

    .hrm-db-wrapper a {
        text-decoration: none;
        color: inherit;
    }

    .hrm-db-wrapper ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* Custom Scrollbar chỉ áp dụng trong wrapper này */
    .hrm-db-wrapper ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .hrm-db-wrapper ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .hrm-db-wrapper ::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

/* ================= LAYOUT ================= */
.hrm-db-header {
    height: 56px;
    background-color: var(--hrm-bg-white);
    box-shadow: var(--hrm-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.hrm-db-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hrm-db-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1024px) {
    .hrm-db-row {
        flex-direction: row;
    }
}

/* ================= COMPONENTS ================= */
.hrm-db-card {
    background-color: var(--hrm-bg-white);
    padding: 20px;
    box-shadow: var(--hrm-shadow-sm);
    border: 1px solid var(--hrm-border-normal);
    border-radius: var(--hrm-radius-sm);
    display: flex;
    flex-direction: column;
}
.hrm-db-card-admin {
    background-color: var(--hrm-bg-white);
    padding: 20px;
    box-shadow: var(--hrm-shadow-sm);
    border: 1px solid var(--hrm-border-normal);
    border-radius: var(--hrm-radius-sm);
    display: flex;
}

.hrm-db-card-title {
    font-weight: 700;
    color: var(--hrm-text-dark);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 12px;
}

/* Header Elements */
.hrm-db-header-left {
    display: flex;
    align-items: center;
    color: var(--hrm-text-muted);
}

    .hrm-db-header-left i {
        margin-right: 16px;
        cursor: pointer;
    }

.hrm-db-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hrm-db-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--hrm-border-normal);
    border: 1px solid var(--hrm-border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hrm-text-muted);
}

/* Profile Card */
.hrm-db-profile {
    width: 100%;
    align-items: center;
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .hrm-db-profile {
        width: 25%;
    }
}

.hrm-db-profile-title {
    width: 100%;
    text-align: left;
    font-weight: 600;
    color: var(--hrm-text-dark);
    margin-bottom: 24px;
}

.hrm-db-avatar-lg {
    width: 128px;
    height: 128px;
    background-color: var(--hrm-border-dark);
    border-radius: 50%;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

    .hrm-db-avatar-lg i {
        font-size: 60px;
        color: var(--hrm-text-light);
        margin-bottom: -8px;
    }

.hrm-db-profile-name {
    font-weight: 700;
    color: var(--hrm-text-bold);
    font-size: 18px;
    width: 100%;
    text-align: left;
    margin: 0;
}

.hrm-db-profile-info {
    width: 100%;
    margin-top: 16px;
    font-size: 12px;
    border-collapse: collapse;
}

    .hrm-db-profile-info td {
        padding: 6px 0;
    }

        .hrm-db-profile-info td:first-child {
            width: 33%;
        }

.hrm-db-bold {
    font-weight: 500;
    color: var(--hrm-text-bold);
}

/* Filter Bar */
.hrm-db-filter {
    background-color: var(--hrm-bg-white);
    padding: 12px;
    box-shadow: var(--hrm-shadow-sm);
    border: 1px solid var(--hrm-border-normal);
    border-radius: var(--hrm-radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.hrm-db-filter-date {
    font-weight: 600;
    color: var(--hrm-text-dark);
    display: flex;
    align-items: center;
    user-select: none;
}

    .hrm-db-filter-date i {
        color: var(--hrm-text-light);
        cursor: pointer;
        padding: 8px;
        margin: 0 8px;
        transition: color 0.2s;
    }

        .hrm-db-filter-date i:hover {
            color: var(--hrm-primary-blue);
        }

.hrm-db-filter-radios {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hrm-db-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s;
    margin: 0;
}

    .hrm-db-radio-label:hover {
        color: var(--hrm-primary-blue);
    }

.hrm-db-filter-select {
    width: 256px;
}

    .hrm-db-filter-select select {
        width: 100%;
        border: 1px solid var(--hrm-border-dark);
        border-radius: var(--hrm-radius-sm);
        padding: 8px 12px;
        color: var(--hrm-text-normal);
        outline: none;
    }

        .hrm-db-filter-select select:focus {
            border-color: var(--hrm-primary-blue);
        }

/* Statistics Layout */
.hrm-db-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

@media (min-width: 1280px) {
    .hrm-db-grid {
        flex-direction: row;
    }
}

.hrm-db-stats-card {
    flex-direction: column;
    display: flex;
}

@media (min-width: 1280px) {
    .hrm-db-stats-card {
        width: 33.333%;
    }
}

/* Stats List */
.hrm-db-stat-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.hrm-db-stat-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--hrm-border-light);
    padding-bottom: 8px;
}

.hrm-db-val {
    font-weight: 700;
    color: var(--hrm-text-bold);
}

/* Timekeeping & Leave layout */
.hrm-db-time-leave {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 1280px) {
    .hrm-db-time-leave {
        width: 66.666%;
    }
}

/* Timekeeping Boxes */
.hrm-db-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hrm-db-time-box {
    border: 1px solid var(--hrm-border-light);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--hrm-bg-hover);
    transition: background-color 0.2s;
}

    .hrm-db-time-box:hover {
        background-color: var(--hrm-bg-white);
    }

.hrm-db-full-width {
    grid-column: span 2;
}

.hrm-db-box-label {
    color: var(--hrm-text-muted);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
}

.hrm-db-val-large {
    font-size: 30px;
    font-weight: 700;
    color: var(--hrm-text-bold);
}

.hrm-db-val-group {
    display: flex;
    gap: 24px;
    text-align: center;
}

.hrm-db-wide {
    gap: 40px;
    margin-right: 8px;
}

.hrm-db-val-sub {
    font-size: 10px;
    color: var(--hrm-text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}

/* Leave Matrix */
.hrm-db-leave-card {
    flex: 1;
    position: relative;
}

    .hrm-db-leave-card .hrm-db-card-title {
        position: absolute;
        top: 20px;
        left: 20px;
        margin: 0;
    }

.hrm-db-leave-total {
    position: absolute;
    top: 20px;
    right: 24px;
    text-align: center;
}

.hrm-db-leave-matrix {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    text-align: center;
    margin-top: 64px;
    padding-top: 8px;
}

    .hrm-db-leave-matrix > div.hrm-db-offset-col {
        grid-column-start: 5;
    }

/* Bottom Row - Calendar & History */
.hrm-db-bottom-row {
    min-height: 400px;
}

/* History */
.hrm-db-history-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hrm-db-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--hrm-border-light);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

    .hrm-db-history-header h3 {
        font-weight: 700;
        color: var(--hrm-text-dark);
        font-size: 14px;
        margin: 0;
    }

    .hrm-db-history-header a {
        color: var(--hrm-primary-blue);
        font-size: 12px;
        font-weight: 600;
    }

        .hrm-db-history-header a:hover {
            text-decoration: underline;
        }

.hrm-db-history-table {
    width: 100%;
    text-align: left;
    font-size: 12px;
    margin-bottom: 24px;
    border-collapse: collapse;
}

    .hrm-db-history-table th {
        color: var(--hrm-text-light);
        font-weight: 600;
        padding-bottom: 12px;
        text-transform: uppercase;
    }

.hrm-db-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--hrm-text-light);
}

    .hrm-db-empty-state i {
        font-size: 48px;
        margin-bottom: 12px;
        color: var(--hrm-border-normal);
    }

    .hrm-db-empty-state p {
        font-size: 14px;
        font-weight: 500;
        margin: 0;
    }
/* ================= CSS BỔ SUNG CHO MÀN HÌNH BẢNG CÔNG ================= */

/* --- Topbar & Actions --- */
.hrm-board-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--hrm-bg-white);
    padding: 12px 16px;
    border-radius: var(--hrm-radius-md);
    box-shadow: var(--hrm-shadow-sm);
}

.hrm-board-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.hrm-board-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hrm-board-date-nav {
    display: flex;
    align-items: center;
    font-weight: 500;
}

    .hrm-board-date-nav i {
        padding: 4px 8px;
        color: var(--hrm-text-light);
        cursor: pointer;
        transition: 0.2s;
    }

        .hrm-board-date-nav i:hover {
            color: var(--hrm-primary-blue);
        }

.hrm-board-select {
    border: 1px solid var(--hrm-border-normal);
    border-radius: var(--hrm-radius-sm);
    padding: 6px 12px;
    color: var(--hrm-text-muted);
    outline: none;
    min-width: 150px;
    background: var(--hrm-bg-white);
}

.hrm-board-btn-outline {
    border: 1px solid var(--hrm-danger-red);
    color: var(--hrm-danger-red);
    background: transparent;
    padding: 6px 16px;
    border-radius: var(--hrm-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
}

    .hrm-board-btn-outline:hover {
        background: #fef2f2;
    }
/* red-50 */

/* --- Stats & Filter Section (Overview) --- */
.hrm-board-overview {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

/* Cột 1: Search Panel */
.hrm-board-search-panel {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.hrm-board-search-box {
    display: flex;
    gap: 8px;
}

.hrm-board-search-input {
    flex: 1;
    border: 1px solid var(--hrm-border-normal);
    border-radius: var(--hrm-radius-sm);
    padding: 8px;
    background: #e5e7eb; /* gray-200, mô phỏng khối xám */
}

.hrm-board-btn-icon {
    border: 1px solid var(--hrm-danger-red);
    background: transparent;
    color: var(--hrm-danger-red);
    padding: 0 12px;
    border-radius: var(--hrm-radius-sm);
    cursor: pointer;
    transition: 0.2s;
}

    .hrm-board-btn-icon:hover {
        background: var(--hrm-danger-red);
        color: white;
    }

.hrm-board-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hrm-text-muted);
    cursor: pointer;
}

.hrm-board-actions {
    display: flex;
    gap: 8px;
}

.hrm-board-btn-primary {
    background: var(--hrm-danger-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--hrm-radius-sm);
    cursor: pointer;
    font-weight: 500;
}

.hrm-board-btn-secondary {
    background: var(--hrm-bg-white);
    color: var(--hrm-text-normal);
    border: 1px solid var(--hrm-border-normal);
    padding: 8px 16px;
    border-radius: var(--hrm-radius-sm);
    cursor: pointer;
}

.hrm-board-radio-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    color: var(--hrm-text-muted);
}

/* Cột 2: Stats Lists (Tái sử dụng một phần class cũ, chỉ thêm grid/flex) */
.hrm-board-stats-panel {
    flex: 1;
    display: flex;
    gap: 32px;
}

.hrm-board-stat-col {
    flex: 1;
}

/* Cột 3: Work Summary */
.hrm-board-summary-panel {
    width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hrm-board-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--hrm-bg-hover);
    border: 1px solid var(--hrm-border-light);
    border-radius: var(--hrm-radius-sm);
}

.hrm-board-summary-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--hrm-text-muted);
    text-transform: uppercase;
    width: 100px;
}

.hrm-board-summary-vals {
    display: flex;
    gap: 24px;
    flex: 1;
    justify-content: space-around;
}

.hrm-board-val-block {
    text-align: center;
}

    .hrm-board-val-block .num {
        font-size: 16px;
        font-weight: bold;
        color: var(--hrm-text-dark);
    }

    .hrm-board-val-block .lbl {
        font-size: 9px;
        color: var(--hrm-text-light);
        text-transform: uppercase;
        margin-top: 2px;
        font-weight: 600;
    }

/* --- Data Grid Section --- */
.hrm-board-grid-container {
    background: var(--hrm-bg-white);
    border-radius: var(--hrm-radius-md);
    box-shadow: var(--hrm-shadow-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hrm-border-normal);
}

/* Tabs */
.hrm-board-tabs {
    display: flex;
    border-bottom: 1px solid var(--hrm-border-normal);
    background: var(--hrm-bg-hover);
}

.hrm-board-tab {
    padding: 12px 24px;
    font-weight: bold;
    color: var(--hrm-danger-red);
    border-bottom: 2px solid var(--hrm-danger-red);
    background: var(--hrm-bg-white);
    cursor: pointer;
    font-size: 13px;
}

/* Data Table (Phức tạp hơn bảng lịch sử ở Dashboard) */
 
.hrm-board-last-update {
    font-size: 11px;
    color: var(--hrm-text-light); /* Màu xám nhạt để nhìn dịu mắt */
    font-weight: 500;
    display: flex;
    align-items: center;
}