/* ==========================================================================
   Hải Vân HRM - Request & Suite Design System (Base Enterprise Style)
   ========================================================================== */

.hrm-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 2rem;
}

/* Header & Quick Action Bar */
.hrm-header-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.hrm-title-area {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.hrm-title-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.hrm-title-text h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hrm-title-text p {
    margin: 0.2rem 0 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
}

.hrm-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Dropdown Menu for New Request */
.hrm-dropdown {
    position: relative;
    display: inline-block;
}

.hrm-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    min-width: 250px;
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: hrmDropdownFade 0.18s ease-out;
}

.hrm-dropdown-menu.show {
    display: block;
}

@keyframes hrmDropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hrm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary, #1e293b);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.hrm-dropdown-item:last-child {
    border-bottom: none;
}

.hrm-dropdown-item:hover {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary, #0284c7);
}

.hrm-dropdown-item i {
    font-size: 1.2rem;
    color: var(--primary, #0284c7);
}

/* Metric KPI Cards Row */
.hrm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.hrm-metric-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.hrm-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.hrm-metric-card.active-filter {
    border-color: var(--primary, #0284c7);
    background: rgba(2, 132, 199, 0.03);
}

.hrm-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}

.hrm-metric-icon.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.hrm-metric-icon.approved {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.hrm-metric-icon.rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.hrm-metric-icon.mine {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

.hrm-metric-info {
    display: flex;
    flex-direction: column;
}

.hrm-metric-label {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    line-height: 1.2;
    margin-top: 0.15rem;
}

/* Filter & Search Bar */
.hrm-filter-bar {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hrm-tab-pills {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-input, #f1f5f9);
    padding: 3px;
    border-radius: 8px;
    overflow-x: auto;
}

.hrm-tab-pill {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.hrm-tab-pill.active {
    background: var(--bg-surface, #ffffff);
    color: var(--primary, #0284c7);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hrm-filter-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hrm-search-box {
    position: relative;
    min-width: 240px;
}

.hrm-search-box input {
    width: 100%;
    padding: 7px 12px 7px 34px;
    font-size: 0.84rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    outline: none;
    transition: border-color 0.18s ease;
}

.hrm-search-box input:focus {
    border-color: var(--primary, #0284c7);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.hrm-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #94a3b8);
    font-size: 1.1rem;
}

.hrm-select {
    padding: 7px 12px;
    font-size: 0.84rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    outline: none;
    cursor: pointer;
}

/* Data Table & Cards View */
.hrm-table-container {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.hrm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    text-align: left;
}

.hrm-table th {
    background: var(--bg-input, #f8fafc);
    color: var(--text-muted, #475569);
    font-weight: 600;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    color: var(--text-primary, #1e293b);
    vertical-align: middle;
}

.hrm-table tr:hover td {
    background: rgba(2, 132, 199, 0.02);
}

.hrm-table tr.clickable {
    cursor: pointer;
}

/* Request Code Badge */
.hrm-req-code {
    display: inline-block;
    font-family: monospace;
    font-weight: 700;
    color: #0369a1;
    background: rgba(2, 132, 199, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* User Info Cell */
.hrm-user-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.hrm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hrm-user-name {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    font-size: 0.86rem;
}

.hrm-user-dept {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
}

/* Status Badges */
.hrm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.hrm-status-badge.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.hrm-status-badge.approved {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.hrm-status-badge.rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.hrm-status-badge.draft {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Stepper Progress in Table */
.hrm-stepper-mini {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hrm-step-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    position: relative;
}

.hrm-step-dot.done {
    background: #10b981;
    color: #ffffff;
}

.hrm-step-dot.current {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
    animation: hrmPulse 1.8s infinite;
}

.hrm-step-dot.rejected {
    background: #ef4444;
    color: #ffffff;
}

.hrm-step-line {
    width: 14px;
    height: 2px;
    background: #cbd5e1;
}

.hrm-step-line.done {
    background: #10b981;
}

@keyframes hrmPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Action Buttons */
.hrm-action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-muted, #64748b);
    transition: all 0.15s ease;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hrm-action-btn:hover {
    background: var(--bg-input, #f1f5f9);
    color: var(--primary, #0284c7);
}

/* Drawer / Slide-Over Modal for Detail */
.hrm-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.hrm-drawer-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.hrm-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 580px;
    max-width: 95vw;
    background: var(--bg-surface, #ffffff);
    box-shadow: -10px 0 35px rgba(0,0,0,0.18);
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.hrm-drawer.show {
    transform: translateX(0);
}

.hrm-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-surface, #ffffff);
}

.hrm-drawer-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hrm-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-surface, #ffffff);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Approval Timeline in Drawer */
.hrm-timeline {
    position: relative;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.hrm-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 10px;
    width: 2px;
    background: #e2e8f0;
}

.hrm-timeline-item {
    position: relative;
}

.hrm-timeline-icon {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    background: #94a3b8;
}

.hrm-timeline-item.done .hrm-timeline-icon {
    background: #10b981;
}

.hrm-timeline-item.current .hrm-timeline-icon {
    background: #f59e0b;
}

.hrm-timeline-item.rejected .hrm-timeline-icon {
    background: #ef4444;
}

.hrm-timeline-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hrm-timeline-sub {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.hrm-timeline-note {
    font-size: 0.8rem;
    background: var(--bg-input, #f8fafc);
    border-left: 3px solid var(--primary, #0284c7);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    margin-top: 6px;
    color: #334155;
}

/* Form Dialog / Modal for Creating Request */
.hrm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hrm-modal-backdrop.show {
    display: flex;
}

.hrm-modal {
    background: var(--bg-surface, #ffffff);
    border-radius: 14px;
    width: 680px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 45px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: hrmModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hrmModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.hrm-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hrm-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.hrm-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form controls inside modal */
.hrm-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hrm-form-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.hrm-form-label .req {
    color: #ef4444;
}

.hrm-form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.88rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    outline: none;
    transition: border-color 0.18s ease;
    box-sizing: border-box;
}

.hrm-form-control:focus {
    border-color: var(--primary, #0284c7);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.hrm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .hrm-form-row {
        grid-template-columns: 1fr;
    }
}

/* Empty State */
.hrm-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted, #94a3b8);
}

.hrm-empty-state i {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    color: #cbd5e1;
}

.hrm-empty-state p {
    margin: 0;
    font-size: 0.92rem;
}

/* Preview Roadmap Card for other modules */
.hrm-roadmap-preview-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 12px);
    padding: 2rem;
    text-align: center;
    max-width: 700px;
    margin: 2rem auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.hrm-roadmap-preview-card i {
    font-size: 3.5rem;
    color: var(--primary, #0284c7);
    margin-bottom: 1rem;
}

.hrm-roadmap-preview-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.hrm-roadmap-preview-card p {
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
