/* HR Management Frontend CSS - Premium Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary-color: #0C8776;
    --primary-hover: #064E4C;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --success-color: #10B981;
    --info-color: #3B82F6;

    /* Gradients */
    --hrm-gradient: linear-gradient(135deg, #064E4C 0%, #0C8776 100%);
    --checkin-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --checkout-gradient: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    --sidebar-gradient: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);

    /* Neutrals */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Typography within Wrapper */
.hrm-portal-wrap,
.hrm-login-wrap {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

/* Layout Stability & Smoothness */
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
    border: 2px solid transparent;
    background-clip: content-box;
}

.hrm-portal-wrap *,
.hrm-login-wrap * {
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/*                                Login Page                                  */
/* -------------------------------------------------------------------------- */

.hrm-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    background: linear-gradient(135deg, #0C8776 0%, #064E4C 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Background Accents */
.hrm-login-wrap::before,
.hrm-login-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}

.hrm-login-wrap::before {
    top: -100px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
}

.hrm-login-wrap::after {
    bottom: -50px;
    left: -50px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
}

.hrm-login-card {
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 450px;
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: none;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Company Logo Styles - Login Page */
.hrm-login-logo {
    margin-bottom: 32px;
    text-align: center;
    animation: logoFadeIn 0.8s ease-out;
}

.hrm-login-logo .hrm-company-logo {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.hrm-login-logo .hrm-company-logo:hover {
    transform: scale(1.02);
}

@keyframes logoFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Company Logo Styles - Portal Sidebar */
.hrm-portal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.hrm-portal-logo .hrm-company-logo {
    max-width: 160px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.hrm-portal-logo .hrm-company-logo:hover {
    opacity: 0.85;
}

/* Responsive adjustments for logo */
@media (max-width: 768px) {
    .hrm-login-logo .hrm-company-logo {
        max-width: 150px;
        max-height: 50px;
    }

    .hrm-portal-logo .hrm-company-logo {
        max-width: 140px;
        max-height: 45px;
    }
}

@media (max-width: 480px) {
    .hrm-login-logo {
        margin-bottom: 24px;
    }

    .hrm-login-logo .hrm-company-logo {
        max-width: 130px;
        max-height: 45px;
    }

    .hrm-portal-logo .hrm-company-logo {
        max-width: 120px;
        max-height: 40px;
    }
}

.hrm-login-header {
    margin-bottom: 36px;
}

.hrm-login-header h2 {
    margin: 0 0 8px;
    font-size: 26px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hrm-login-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.hrm-login-error {
    background: #FEF2F2;
    color: #991B1B;
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    text-align: left;
    border-left: 4px solid #EF4444;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.hrm-login-error::before {
    content: '\f158';
    /* dashicons-warning */
    font-family: 'dashicons';
    font-size: 20px;
    color: #EF4444;
}

/* Forms (Shared) */
.hrm-form-group {
    margin-bottom: 24px;
    text-align: left;
}

.hrm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.hrm-form-group .input,
.hrm-form-group input[type="text"],
.hrm-form-group input[type="password"],
.hrm-form-group input[type="email"],
.hrm-form-group input[type="date"],
.hrm-form-group input[type="number"],
.hrm-form-group select,
.hrm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #F9FAFB;
    color: var(--text-main);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hrm-form-group input:focus,
.hrm-form-group select:focus,
.hrm-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(12, 135, 118, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hrm-remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    user-select: none;
}

.hrm-remember-me input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.hrm-remember-me label {
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

/* -------------------------------------------------------------------------- */
/*                             Employee Portal                                */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/*                             Employee Portal                                */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/*                             Employee Portal                                */
/* -------------------------------------------------------------------------- */

.hrm-portal-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    position: relative;
    font-family: 'Inter', sans-serif;
    background: #F8FAFC;
    min-height: 100vh;
}

/* Sidebar */
.hrm-sidebar {
    width: 260px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 32px 20px;
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    border: none;
    z-index: 100;
}

.hrm-nav-scroll {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    margin-right: -4px;
    -webkit-overflow-scrolling: touch;
}

.hrm-nav-scroll::-webkit-scrollbar {
    width: 4px;
}

.hrm-sidebar-header {
    margin-bottom: 40px;
    padding: 0 12px 24px;
    border-bottom: none;
}

.hrm-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrm-nav-section {
    margin-bottom: 24px;
}

.hrm-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    letter-spacing: 0.1em;
    font-weight: 700;
    padding: 0 12px;
    margin-bottom: 12px;
}

.hrm-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hrm-tab-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    color: #64748B;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.hrm-tab-btn:hover {
    background: #F1F5F9;
    color: #334155;
}

.hrm-tab-btn.active {
    background: #E0F2F1;
    /* Light Teal/Green */
    color: #0F766E;
    font-weight: 600;
}

.hrm-tab-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    opacity: 0.9;
}

.hrm-tab-btn.logout {
    margin-top: auto;
    color: #EF4444;
    background: #FEF2F2;
    padding: 0;
    /* Wrapper for link */
}

.hrm-tab-btn.logout a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    padding: 10px 16px;
    color: inherit;
    text-decoration: none;
}

.hrm-tab-btn.logout:hover {
    background: #FEE2E2;
}

/* Content Area */
.hrm-content-area {
    flex: 1;
    min-width: 0;
}

.hrm-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 16px 0;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.hrm-portal-scrolled .hrm-top-bar {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    margin-left: -20px;
    margin-right: -20px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.hrm-main-scroll {
    scroll-margin-top: 100px;
    width: 100%;
    position: relative;
}

/* Ensure no nested scrolling unless explicitly needed */
.hrm-main-scroll {
    overflow: visible;
}

.hrm-tab-content {
    scroll-margin-top: 100px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hrm-hero-section {
    background: linear-gradient(135deg, #0E7490 0%, #0891B2 100%);
    /* Dark Teal Gradient */
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(14, 116, 144, 0.2);
    margin-bottom: 32px;
    color: white;
    position: relative;
    overflow: hidden;
    height: 180px;
    display: flex;
    align-items: center;
}

.hrm-hero-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.hrm-hero-section p {
    font-size: 15px;
    opacity: 0.9;
}

/* Overview Stats Grid */
.hrm-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.hrm-mini-stat {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    border: 1px solid #F3F4F6;
    transition: transform 0.2s;
}

.hrm-mini-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-header .label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9CA3AF;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.stat-header .icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #0E7490;
    /* Default Icon Color */
    opacity: 0.7;
}

.hrm-mini-stat .value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

/* Attendance & Timer */
.hrm-attendance-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.hrm-attendance-box {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0;
    border: none;
    overflow: hidden;
    margin-bottom: 32px;
}

.hrm-attendance-hero {
    background: #fff;
    padding: 48px;
    text-align: center;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hrm-history-section {
    padding: 32px;
}

.hrm-history-section h4 {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: 700;
    color: #1E293B;
}

.hrm-status-indicator {
    background: #E2E8F0;
    color: #64748B;
    margin-bottom: 40px;
    box-shadow: none;
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hrm-status-indicator.active {
    background: #DCFCE7;
    color: #166534;
}

.hrm-status-indicator.completed {
    background: #DBEAFE;
    color: #1E40AF;
}

.hrm-timer-wrapper {
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    margin: 0 auto 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 8px solid #F8FAFC;
}

.hrm-timer-wrapper::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 4px solid #F1F5F9;
}

.hrm-timer-bg {
    font-size: 56px;
    font-weight: 800;
    color: #0F172A;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
}

.hrm-timer-label {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hrm-btn-checkin {
    background: #10B981 !important;
    color: white !important;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
    min-width: 180px;
    border: none;
    cursor: pointer;
}

.hrm-btn-checkin:hover {
    background: #059669 !important;
}

.hrm-btn-red {
    background: #EF4444 !important;
    color: white !important;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    min-width: 180px;
    border: none;
    cursor: pointer;
}

/* Table & Content Scrolling Stability */
.hrm-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    margin-bottom: 24px;
    scrollbar-width: thin;
}

.hrm-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.hrm-table-wrapper::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}

.hrm-history-table thead {
    background: #fff;
    border-bottom: 2px solid #F1F5F9;
}

.hrm-history-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94A3B8;
    font-weight: 800;
}

.hrm-history-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    vertical-align: middle;
}

.hrm-history-table tr:last-child td {
    border-bottom: none;
}

.hrm-history-table tr:hover {
    background: #F8FAFC;
}

/* Status Badges in Table */
.hrm-notice {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.hrm-notice.error {
    /* Absent */
    background: #F1F5F9;
    color: #64748B;
}

.hrm-notice.success {
    /* Present */
    background: #F1F5F9;
    /* Keeping it subtle per image, or use green */
    color: #0F172A;
}

/* Tasks */
.hrm-tasks-list ul li {
    background: #fff;
    border: 1px solid #F3F4F6;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hrm-tasks-list ul li:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: transparent;
    transform: translateY(-2px);
}

.hrm-tasks-list ul li.completed {
    border-left: 5px solid var(--success-color);
    background: #F9FAFB;
}

.task-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.task-info strong {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--text-main);
    font-weight: 700;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.task-info p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0 0 16px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    hyphens: auto;
}

.task-info small {
    display: inline-flex;
    align-items: center;
    background: #F3F4F6;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #4B5563;
}

/* Buttons */
.hrm-btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 15px;
    position: relative;
    user-select: none;
    overflow: hidden;
}

.hrm-btn:disabled,
.hrm-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: grayscale(0.5);
    pointer-events: none;
}

/* Loading State */
.hrm-btn.loading {
    color: transparent !important;
    pointer-events: none;
}

.hrm-btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: hrm-spin 0.8s infinite linear;
    left: 50%;
    top: 50%;
    margin-left: -9px;
    margin-top: -9px;
}

.hrm-btn-primary.loading::after,
.hrm-btn-green.loading::after,
.hrm-btn-red.loading::after,
.hrm-btn-blue.loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

@keyframes hrm-spin {
    to {
        transform: rotate(360deg);
    }
}

.hrm-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hrm-btn-primary {
    background: var(--hrm-gradient) !important;
    color: white !important;
    border: none !important;
    text-shadow: none !important;
}

.hrm-btn-green {
    background: var(--checkin-gradient) !important;
    color: white !important;
    border: none !important;
}

.hrm-btn-red {
    background: var(--checkout-gradient) !important;
    color: white !important;
    border: none !important;
}

.hrm-btn-blue {
    background: #3B82F6 !important;
    color: white !important;
    border: none !important;
}

.hrm-btn-large {
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    min-width: 220px;
}

/* Profile */
.hrm-profile-upload {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.profile-avatar-preview,
.profile-avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.profile-avatar-placeholder {
    background: #E0E7FF;
    color: #3730A3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
}

.upload-overlay {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 2px solid white;
    transition: transform 0.2s;
}

.hrm-profile-upload:hover .upload-overlay {
    transform: scale(1.05);
}

/* Notifications Toast */
.hrm-toast-container {
    padding: 20px;
    pointer-events: none;
}

.hrm-toast {
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Mobile & Tablet Refinements */
@media (max-width: 1024px) {
    .hrm-portal-wrap {
        gap: 0;
        padding: 0;
    }

    .hrm-sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        border-radius: 0;
        z-index: 1000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        /* Always flex but hidden by transform */
        margin: 0;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    }

    .hrm-sidebar.active {
        transform: translateX(280px);
    }

    /* Backdrop for mobile sidebar */
    .hrm-sidebar.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: -1;
        cursor: pointer;
    }

    .hrm-content-area {
        padding: 20px;
        width: 100%;
        overflow-x: hidden;
    }

    .hrm-top-bar {
        margin-left: -20px;
        margin-right: -20px;
        padding: 12px 20px;
        border-radius: 0;
    }

    .hrm-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hrm-stats-row {
        grid-template-columns: 1fr;
    }

    .hrm-hero-section {
        height: auto;
        min-height: 160px;
        padding: 30px 24px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .hrm-hero-section h1 {
        font-size: 24px;
    }

    .hrm-top-actions {
        gap: 12px;
    }

    /* .hrm-search-wrap handled by new expandable logic */

    .hrm-user-pill span {
        display: none;
        /* Hide name on small mobile */
    }

    .hrm-user-pill {
        padding: 4px;
    }

    /* Tables handling */
    .hrm-table-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hrm-table-wrapper::-webkit-scrollbar {
        height: 5px;
    }

    /* Form Grids */
    .hrm-form-grid,
    .hrm-form-row {
        grid-template-columns: 1fr !important;
    }

    /* Modal scaling */
    .hrm-modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 10px auto !important;
    }

    .hrm-btn-large {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hrm-leave-stats {
        grid-template-columns: 1fr;
    }

    .hrm-top-bar {
        padding: 10px 16px;
    }

    .hrm-breadcrumb {
        display: none;
    }
}

@keyframes slideRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* -------------------------------------------------------------------------- */
/*                           New Layout Components                            */
/* -------------------------------------------------------------------------- */

/* Sidebar Grouping */
.hrm-nav-scroll {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hrm-nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hrm-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9CA3AF;
    font-weight: 700;
    padding: 0 16px;
    margin: 0 0 4px;
}

/* Sidebar Header Tweaks */
.hrm-sidebar-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
}

.hrm-sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

/* Tab Btn Adjustments for cleaner look */
.hrm-tab-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.hrm-tab-btn.active {
    background: rgba(12, 135, 118, 0.1);
    color: var(--primary-color);
    box-shadow: none;
    border-left: 3px solid var(--primary-color);
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Sticky Header Clean Consolidated */
.hrm-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 16px 20px;
    background: rgba(248, 250, 252, 0.85);
    /* Matches body background with transparency */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid transparent;
}

.hrm-portal-scrolled .hrm-top-bar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    padding: 12px 24px;
}

/* Search Bar Premium Design */
.hrm-search-container {
    flex: 1;
    max-width: 580px;
    display: flex;
    align-items: center;
}

.hrm-search-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hrm-search-mobile-toggle:hover {
    background: #F1F5F9;
    color: var(--primary-color);
}

.hrm-search-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.hrm-search-wrap .dashicons-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 18px;
    width: 18px;
    height: 18px;
    z-index: 2;
    transition: all 0.3s ease;
}

.hrm-top-search {
    width: 100%;
    padding: 12px 16px 12px 48px !important;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC !important;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    height: 46px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hrm-top-search::placeholder {
    color: #94A3B8;
    font-weight: 400;
}

.hrm-top-search:focus {
    background: #FFFFFF !important;
    border-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(12, 135, 118, 0.08), 0 4px 6px -2px rgba(12, 135, 118, 0.03);
    outline: none;
}

.hrm-top-search:focus+.dashicons-search {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.hrm-search-close-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hrm-search-mobile-toggle {
        display: flex;
    }

    .hrm-search-wrap {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: white;
        z-index: 1100;
        padding: 0 16px;
        transform: translateY(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .hrm-search-wrap.active {
        transform: translateY(0);
    }

    .hrm-search-wrap .dashicons-search {
        left: 28px;
    }

    .hrm-top-search {
        background: #F8FAFC !important;
        border-radius: 12px;
        height: 44px;
    }

    .hrm-search-close-mobile {
        display: flex;
        background: #F1F5F9;
        border: none;
        color: #64748B;
        padding: 8px;
        border-radius: 10px;
        cursor: pointer;
    }
}

.hrm-top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 24px;
}

.hrm-notif-bell {
    position: relative;
    cursor: pointer;
    color: #64748B;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.hrm-notif-bell:hover {
    color: var(--primary-color);
    background: #F1F5F9;
}

.hrm-notif-bell .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Badge Logic */
.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
    /* Toggled by JS */
    color: white;
    font-size: 9px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
}

/* User Pill Clean */
.hrm-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hrm-user-pill:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(12, 135, 118, 0.1);
    transform: translateY(-1px);
}

.user-avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0C8776;
    /* Premium teal from screenshot */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid white;
    box-shadow: 0 0 0 1px #E2E8F0;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}

/* Stats Row */
.hrm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.hrm-mini-stat {
    background: white;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #F3F4F6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hrm-mini-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: rgba(16, 185, 129, 0.2);
}

.hrm-mini-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s;
}

.hrm-mini-stat:hover::after {
    background: var(--primary-color);
}

.hrm-mini-stat .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hrm-mini-stat .label {
    color: #6B7280;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-mini-stat .icon {
    font-size: 20px;
    color: var(--primary-color);
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.hrm-mini-stat .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.hrm-mini-stat .trend {
    font-size: 12px;
    margin-top: 8px;
    color: 10B981;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Table Enhancements */
.hrm-table tbody tr:nth-child(even),
.hrm-history-table tbody tr:nth-child(even) {
    background-color: #F9FAFB;
}

.hrm-table tbody tr:hover,
.hrm-history-table tbody tr:hover {
    background-color: #F3F4F6;
}

/* Scrollbar Polish */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Task Checklist Inputs */
.tiny-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    margin-top: 4px;
    background: #fff;
    transition: all 0.2s;
}

.tiny-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 135, 118, 0.1);
    outline: none;
}

/* Notifications List */
.hrm-notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hrm-notif-list li {
    padding: 16px 0;
    border-bottom: 1px solid #F3F4F6;
}

.hrm-notif-list li:last-child {
    border-bottom: none;
}

.hrm-notif-list li p {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hrm-notif-list li p::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-main);
}

.hrm-notif-list li small {
    display: block;
    margin-left: 14px;
    font-size: 12px;
    color: var(--text-secondary);
}

.tiny-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(12, 135, 118, 0.1);
}

/* Notices */
.hrm-content-notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: #F9FAFB;
    border-left: 4px solid #3B82F6;
    margin-bottom: 24px;
    font-size: 14px;
    color: #1F2937;
}

.hrm-content-notice.success {
    background: #ECFDF5;
    border-left-color: #10B981;
    color: #065F46;
}

.hrm-content-notice.error {
    background: #FEF2F2;
    border-left-color: #EF4444;
    color: #991B1B;
}

/* Tab Content Visibility Logic */
.hrm-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

.hrm-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Styles - Base definition (will be enhanced by later rules) */
.hrm-modal {
    display: none;
    position: fixed !important;
    z-index: 2147483647 !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    isolation: isolate;
    contain: layout style paint;
}

.hrm-modal.active,
.hrm-modal[style*="display: block"],
.hrm-modal[style*="display:block"] {
    display: flex !important;
}

.hrm-modal-content {
    background-color: var(--bg-card) !important;
    margin: auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2147483647;
    animation: hrmSlideUp 0.25s ease-out;
    isolation: isolate;
    overflow: hidden;
}

@keyframes hrmSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hrm-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    position: relative;
    z-index: 1;
}

.hrm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.hrm-close-modal {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: relative;
    z-index: 10;
}

.hrm-close-modal:hover {
    color: var(--danger-color);
}

.hrm-modal-body {
    padding: 24px;
    background: var(--bg-card);
    position: relative;
}

.hrm-modal-footer {
    padding: 16px 24px;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* --- New Animations & Enhanced UI (Frontend) --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.hrm-mini-stat {
    /* ensure existing transition is compatible */
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    transition: transform 0.2s, box-shadow 0.2s;
    /* Re-affirm transition */
}

.hrm-mini-stat:nth-child(1) {
    animation-delay: 0.1s;
}

.hrm-mini-stat:nth-child(2) {
    animation-delay: 0.2s;
}

.hrm-mini-stat:nth-child(3) {
    animation-delay: 0.3s;
}

/* Pulse Animation for Check-in Button */
@keyframes pulse-ring {
    0% {
        transform: scale(0.33);
    }

    80%,
    100% {
        opacity: 0;
    }
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.hrm-check-in-btn-wrapper {
    position: relative;
    display: inline-block;
}

.hrm-check-in-btn {
    position: relative;
    transition: transform 0.2s;
}

.hrm-check-in-btn.pulse {
    animation: pulse-dot 2s infinite;
}

.hrm-check-in-btn:hover {
    transform: scale(1.05);
    /* User requirement: slight scale up */
}

/* Late Badge Pulse */
.badge-yellow.animated-late,
.hrm-notice.warning.animated-late {
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Slide In for Toasts (if used in frontend) */
@keyframes hrmSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.hrm-toast-notification {
    animation: hrmSlideInRight 0.3s ease-out;
}

/* ==========================================
   MODAL STYLES (Shared - Tasks, Leave, etc.)
   ========================================== */

.hrm-modal {
    display: none;
    /* IMPORTANT: Hidden by default */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    isolation: isolate;
    contain: layout style paint;
    padding: 20px;
    box-sizing: border-box;
}

.hrm-modal.active,
.hrm-modal[style*="display: block"],
.hrm-modal[style*="display:block"] {
    display: flex !important;
}

.hrm-modal-content {
    background: var(--bg-card) !important;
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2147483647;
    isolation: isolate;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hrm-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 1;
}

.hrm-modal-header h3,
.hrm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.hrm-close-modal,
.hrm-modal-close {
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    position: relative;
    z-index: 10;
}

.hrm-close-modal:hover,
.hrm-modal-close:hover {
    color: var(--text-main);
    background: var(--bg-body);
}

.hrm-modal-body {
    padding: 24px;
    background: var(--bg-card);
    position: relative;
}

.hrm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================
   LEAVE MANAGEMENT MODULE (Employee Portal)
   ========================================== */

/* Leave Section Container */
.hrm-leave-section {
    padding: 0;
}

.hrm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.hrm-section-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hrm-section-header h2 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

/* Leave Stats Cards */
.hrm-leave-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.hrm-leave-stat-card {
    padding: 28px 24px;
    border-radius: 16px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hrm-leave-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hrm-leave-stat-card .stat-icon {
    font-size: 42px;
    margin-bottom: 16px;
    opacity: 0.95;
}

.hrm-leave-stat-card .stat-icon .dashicons {
    font-size: 42px;
    width: 42px;
    height: 42px;
}

.hrm-leave-stat-card .stat-value {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hrm-leave-stat-card .stat-label {
    font-size: 15px;
    font-weight: 600;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Leave History Container */
.hrm-leave-history {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #F1F5F9;
}

.hrm-leave-history h3 {
    margin: 0 0 24px 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

/* Empty State */
.hrm-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.hrm-empty-state .dashicons {
    font-size: 72px;
    width: 72px;
    height: 72px;
    opacity: 0.2;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.hrm-empty-state p {
    font-size: 17px;
    margin: 20px 0 32px;
    color: var(--text-secondary);
}

/* Leave List */
.hrm-leave-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hrm-leave-item {
    background: var(--bg-body);
    border-radius: 16px;
    padding: 24px;
    border-left: 5px solid;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hrm-leave-item:hover {
    background: #fff;
    transform: translateX(6px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hrm-leave-status-pending {
    border-left-color: var(--warning-color);
}

.hrm-leave-status-approved {
    border-left-color: var(--success-color);
}

.hrm-leave-status-rejected {
    border-left-color: var(--danger-color);
}

/* Leave Item Header */
.hrm-leave-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hrm-leave-type {
    flex: 1;
}

.hrm-leave-status {
    flex-shrink: 0;
}

/* Leave Type Badges */
.hrm-leave-type-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.hrm-leave-type-casual {
    background: #E0F2FE;
    color: #075985;
}

.hrm-leave-type-sick {
    background: #FEE2E2;
    color: #991B1B;
}

.hrm-leave-type-annual {
    background: #D1FAE5;
    color: #065F46;
}

.hrm-leave-type-unpaid {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Status Badges */
.hrm-status-badge {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.hrm-status-approved {
    background: #D1FAE5;
    color: #065F46;
}

.hrm-status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

/* Leave Item Body */
.hrm-leave-item-body {
    margin-bottom: 20px;
}

.hrm-leave-dates {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hrm-leave-date-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hrm-leave-date-item .label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.hrm-leave-date-item .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.hrm-leave-date-separator {
    font-size: 24px;
    color: var(--border-color);
    font-weight: 300;
}

.hrm-leave-duration {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(12, 135, 118, 0.3);
}

.hrm-leave-reason,
.hrm-leave-remarks {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.7;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hrm-leave-reason strong,
.hrm-leave-remarks strong {
    color: var(--text-main);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

/* Leave Item Actions */
.hrm-leave-item-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Form Styles for Leave Modal */
.hrm-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
    background: #F9FAFB;
}

.hrm-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(12, 135, 118, 0.1);
}

.hrm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hrm-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Modal Styles - Main definitions in later section, these provide overrides */
.hrm-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    isolation: isolate;
    contain: layout style paint;
    padding: 20px;
    box-sizing: border-box;
}

/* Force flex when jQuery fadeIn sets display: block */
.hrm-modal[style*="display: block"],
.hrm-modal[style*="display:block"] {
    display: flex !important;
}

.hrm-modal-content {
    background: var(--bg-card) !important;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2147483647;
    isolation: isolate;
}

.hrm-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 1;
}

.hrm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.hrm-modal-close {
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    position: relative;
    z-index: 10;
}

.hrm-modal-close:hover {
    color: var(--text-main);
    background: var(--bg-body);
}

.hrm-modal-body {
    padding: 24px;
    background: var(--bg-card);
    position: relative;
}

/* Button Variants */
.hrm-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-weight: 600;
}

.hrm-btn-sm .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.hrm-btn-outline {
    background: white !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.hrm-btn-outline:hover {
    background: var(--bg-body) !important;
    border-color: var(--text-secondary) !important;
}

.hrm-btn-danger {
    background: #FEE2E2 !important;
    color: #991B1B !important;
    border: 1px solid #FECACA !important;
}

.hrm-btn-danger:hover {
    background: #FECACA !important;
    color: #7F1D1D !important;
}

/* ==========================================
   LEAVE HISTORY - MODERN CARD DESIGN
   ========================================== */

.hrm-leave-history-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}

.hrm-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.hrm-section-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrm-section-title h3 .dashicons {
    color: var(--primary-color);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.hrm-badge-count {
    background: rgba(12, 135, 118, 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Empty State Modern */
.hrm-empty-state-modern {
    text-align: center;
    padding: 60px 20px;
}

.hrm-empty-state-modern .empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(12, 135, 118, 0.1) 0%, rgba(12, 135, 118, 0.2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.hrm-empty-state-modern .empty-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: var(--primary-color);
}

.hrm-empty-state-modern h4 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.hrm-empty-state-modern p {
    color: #6B7280;
    font-size: 15px;
    margin: 0 0 24px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Leave Cards Container */
.hrm-leave-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Leave Card */
.hrm-leave-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1px solid #F3F4F6;
}

.hrm-leave-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Clickable Leave Card */
.hrm-leave-card-clickable {
    cursor: pointer;
}

.hrm-leave-card-clickable:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(12, 135, 118, 0.15);
}

/* Card Header */
.hrm-leave-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.hrm-leave-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hrm-leave-card-right {
    flex-shrink: 0;
}

.hrm-leave-submitted {
    font-size: 13px;
    color: #9CA3AF;
}

/* Status Pill */
.hrm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hrm-status-pill .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Card Body */
.hrm-leave-card-body {
    padding: 0;
}

/* Date Range */
.hrm-leave-date-range {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #F9FAFB;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.hrm-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 70px;
}

.hrm-date-label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-date-value {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.hrm-date-year {
    font-size: 12px;
    color: #6B7280;
}

.hrm-date-arrow {
    color: #D1D5DB;
    display: flex;
    align-items: center;
}

.hrm-date-arrow .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.hrm-days-count {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--hrm-gradient);
    color: var(--bg-card);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    min-width: 60px;
}

.hrm-days-count .days-number {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.hrm-days-count .days-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
}

/* Reason Box */
.hrm-leave-reason-box {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
}

.hrm-leave-reason-box .reason-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 6px;
}

.hrm-leave-reason-box .reason-text {
    color: var(--text-main);
}

/* Admin Remarks Box */
.hrm-admin-remarks-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.hrm-admin-remarks-box>.dashicons {
    flex-shrink: 0;
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.hrm-admin-remarks-box .remarks-label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.hrm-admin-remarks-box .remarks-text {
    display: block;
}

/* Card Footer */
.hrm-leave-card-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Outline Buttons */
.hrm-btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.hrm-btn-outline-primary:hover {
    background: rgba(12, 135, 118, 0.1);
}

.hrm-btn-outline-primary .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.hrm-btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.hrm-btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.hrm-btn-outline-danger .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Leave Type Badges */
.hrm-leave-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.hrm-leave-type-casual {
    background: #DBEAFE;
    color: #1D4ED8;
}

.hrm-leave-type-sick {
    background: #FEE2E2;
    color: #DC2626;
}

.hrm-leave-type-annual {
    background: #D1FAE5;
    color: #059669;
}

.hrm-leave-type-unpaid {
    background: #F3F4F6;
    color: #6B7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hrm-leave-stats {
        grid-template-columns: 1fr;
    }

    .hrm-section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .hrm-section-header .hrm-btn-primary {
        width: 100%;
    }

    .hrm-leave-dates {
        flex-direction: column;
        align-items: flex-start;
    }

    .hrm-leave-duration {
        margin-left: 0;
    }

    .hrm-form-row {
        grid-template-columns: 1fr;
    }

    .hrm-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .hrm-leave-item-actions {
        flex-direction: column;
    }

    .hrm-leave-item-actions .hrm-btn-sm {
        width: 100%;
        justify-content: center;
    }

    /* Leave Card Responsive */
    .hrm-leave-date-range {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .hrm-date-arrow {
        transform: rotate(90deg);
    }

    .hrm-days-count {
        margin-left: 0;
        width: 100%;
    }

    .hrm-leave-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hrm-leave-card-footer {
        flex-direction: column;
    }

    .hrm-leave-card-footer button {
        width: 100%;
        justify-content: center;
    }

    .hrm-section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ==========================================
   LEAVE HISTORY PAGINATION & PAGE SIZE
   ========================================== */

/* History controls container */
.hrm-history-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Page size control */
.hrm-page-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.hrm-page-size-control label {
    font-weight: 500;
    color: var(--text-secondary);
}

.hrm-page-size-label {
    font-weight: 400;
}

/* Small select dropdown */
.hrm-select-sm {
    padding: 6px 28px 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 55px;
}

.hrm-select-sm:hover {
    border-color: var(--primary-color);
}

.hrm-select-sm:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 135, 118, 0.1);
}

/* Export Controls */
.hrm-export-controls {
    display: flex;
    align-items: center;
}

.hrm-export-dropdown {
    position: relative;
}

.hrm-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #0C8776 !important;
    background: #E6F7F5 !important;
    border: 1px solid #B2E8E0 !important;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: none;
}

.hrm-btn-export:hover {
    background: #D1F2ED !important;
    border-color: #0C8776 !important;
    color: #0C8776 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(12, 135, 118, 0.15) !important;
}

.hrm-btn-export:active {
    background: #C0EDE6 !important;
    transform: translateY(0);
    box-shadow: none !important;
    color: #0C8776 !important;
}

.hrm-btn-export .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #0C8776 !important;
}

.hrm-btn-export .dashicons-arrow-down-alt2 {
    font-size: 12px;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    opacity: 0.9;
    color: #0C8776 !important;
}

.hrm-btn-export:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(12, 135, 118, 0.2) !important;
    color: #0C8776 !important;
}

.hrm-btn-export:hover .dashicons,
.hrm-btn-export:focus .dashicons,
.hrm-btn-export:active .dashicons {
    color: #0C8776 !important;
}

/* Export Dropdown Menu */
.hrm-export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    outline: none !important;
}

.hrm-export-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hrm-export-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151 !important;
    background: var(--bg-card) !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    box-shadow: none !important;
}

.hrm-export-option:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.hrm-export-option:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.hrm-export-option:hover {
    background: rgba(12, 135, 118, 0.1) !important;
    color: var(--primary-color) !important;
}

.hrm-export-option:focus {
    outline: none !important;
    box-shadow: none !important;
}

.hrm-export-option .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #6B7280 !important;
}

.hrm-export-option:hover .dashicons {
    color: var(--primary-color);
}

.hrm-export-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spin animation for loading state */
@keyframes hrm-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hrm-spin {
    animation: hrm-spin 1s linear infinite;
}

/* Leave pagination container */
.hrm-leave-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

.hrm-pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.hrm-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pagination buttons */
.hrm-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.hrm-pagination-btn:hover:not(:disabled) {
    background: var(--bg-body);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hrm-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hrm-pagination-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Page numbers container */
.hrm-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Individual page number buttons */
.hrm-page-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.hrm-page-num:hover {
    background: var(--bg-body);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hrm-page-num.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-card);
}

/* Hidden class for pagination */
.hrm-hidden {
    display: none !important;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .hrm-leave-pagination {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .hrm-pagination-info {
        text-align: center;
    }

    .hrm-pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hrm-history-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hrm-page-size-control {
        order: 1;
    }
}

/* ==========================================
   MODAL STYLES (Frontend) - Fixed for Leave History
   ========================================== */

/* Base Modal Overlay - Maximum z-index and full screen coverage */
.hrm-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    padding: 20px;
    box-sizing: border-box;
    isolation: isolate;
    /* Creates new stacking context */
    contain: layout style paint;
    /* Prevent layout bleeding */
}

/* When modal is visible via jQuery fadeIn */
.hrm-modal[style*="display: block"],
.hrm-modal[style*="display:block"],
.hrm-modal.active {
    display: flex !important;
}

/* Modal Content Container - Completely isolated */
.hrm-modal-content {
    background: var(--bg-card) !important;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease-out;
    position: relative;
    z-index: 2147483647;
    isolation: isolate;
    /* New stacking context for content */
    contain: layout style;
}

/* Ensure modal content doesn't inherit any problematic styles */
.hrm-modal-content * {
    position: relative;
}

/* Force ALL headers and navigation behind modal when open */
body.hrm-modal-open .hrm-header,
body.hrm-modal-open .hrm-top-bar,
body.hrm-modal-open .site-header,
body.hrm-modal-open header:not(.hrm-modal-header),
body.hrm-modal-open .hrm-search-wrap,
body.hrm-modal-open .hrm-user-drop,
body.hrm-modal-open .hrm-wrap>.hrm-header-section,
body.hrm-modal-open .hrm-section-header,
body.hrm-modal-open .hrm-leave-section>.hrm-section-header,
body.hrm-modal-open [class*="header"]:not(.hrm-modal-header):not(.hrm-modal-header-premium):not(.card-header):not(.stat-header),
body.hrm-modal-open [class*="navbar"],
body.hrm-modal-open [class*="top-bar"],
body.hrm-modal-open [class*="navigation"],
body.hrm-modal-open .hrm-hero-section,
body.hrm-modal-open nav {
    z-index: 1 !important;
    position: relative !important;
}

/* Prevent scroll and create visual isolation when modal is open */
body.hrm-modal-open {
    overflow: hidden !important;
    position: relative;
}

/* Additional fix: Hide problematic fixed/sticky elements behind modal */
body.hrm-modal-open *:not(.hrm-modal):not(.hrm-modal *) {
    z-index: auto;
}

/* Ensure the modal itself maintains highest z-index */
body.hrm-modal-open .hrm-modal {
    z-index: 2147483647 !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header - Clean and isolated */
.hrm-modal .hrm-modal-header,
.hrm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--hrm-gradient) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 1;
}

.hrm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

/* Modal Close Button */
.hrm-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: transparent;
    border: none;
    position: relative;
    z-index: 10;
}

.hrm-modal-close:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

/* Modal Body - Clean background */
.hrm-modal .hrm-modal-body,
.hrm-modal-body {
    padding: 24px;
    background: var(--bg-card);
    position: relative;
}

/* Modal Footer */
.hrm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Premium Modal Header (for Leave details) - Uses plugin's primary gradient */
.hrm-modal-header-premium {
    position: relative;
    z-index: 1;
    background: var(--hrm-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 32px;
    color: #ffffff;
}

.hrm-modal-header-premium h2,
.hrm-modal-header-premium .header-text h2,
.hrm-modal-header-premium p,
.hrm-modal-header-premium #leave-modal-subtitle,
.hrm-modal-header-premium span {
    color: #ffffff !important;
}

.hrm-modal-body-premium {
    background: var(--bg-card);
    position: relative;
}

/* Close button for premium header */
.hrm-modal-close-premium {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    position: absolute;
    top: 16px;
    right: 16px;
}

.hrm-modal-close-premium:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bg-card);
}

/* ========================================== */
/*           NOTIFICATIONS PAGE               */
/* ========================================== */

.hrm-notifications-page {
    padding: 0;
}

/* Page Header */
.hrm-notifications-page .hrm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.hrm-notifications-page .hrm-page-header .header-left h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.hrm-notifications-page .hrm-page-header .header-left h2 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

.hrm-notifications-page .hrm-page-header .header-left p {
    margin: 0;
    color: #6B7280;
    font-size: 14px;
}

.hrm-notifications-page .hrm-page-header .header-right {
    display: flex;
    gap: 12px;
}

/* Stats Bar */
.hrm-notif-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hrm-notif-stats .notif-stat {
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #E5E7EB;
}

.hrm-notif-stats .notif-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.hrm-notif-stats .notif-stat .stat-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hrm-notif-stats .notif-stat.unread {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-color: #FCD34D;
}

.hrm-notif-stats .notif-stat.unread .stat-value {
    color: #92400E;
}

.hrm-notif-stats .notif-stat.read {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-color: #6EE7B7;
}

.hrm-notif-stats .notif-stat.read .stat-value {
    color: #065F46;
}

/* Notifications Container */
.hrm-notifications-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

/* Empty State */
.hrm-notifications-container .hrm-empty-state {
    padding: 60px 24px;
    text-align: center;
}

.hrm-notifications-container .hrm-empty-state .empty-icon {
    width: 80px;
    height: 80px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.hrm-notifications-container .hrm-empty-state .empty-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #9CA3AF;
}

.hrm-notifications-container .hrm-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.hrm-notifications-container .hrm-empty-state p {
    margin: 0;
    color: #6B7280;
    font-size: 14px;
}

/* Notifications List */
.hrm-notifications-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hrm-notifications-list .notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.2s ease;
    position: relative;
}

.hrm-notifications-list .notification-item:last-child {
    border-bottom: none;
}

.hrm-notifications-list .notification-item:hover {
    background: #F9FAFB;
}

/* Unread styling */
.hrm-notifications-list .notification-item.unread {
    background: #FFFBEB;
    border-left: 4px solid #F59E0B;
}

.hrm-notifications-list .notification-item.unread:hover {
    background: #FEF3C7;
}

.hrm-notifications-list .notification-item.unread::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 12px;
    width: 8px;
    height: 8px;
    background: #F59E0B;
    border-radius: 50%;
}

/* Read styling */
.hrm-notifications-list .notification-item.read {
    background: #FAFAFA;
    border-left: 4px solid transparent;
}

.hrm-notifications-list .notification-item.read .notif-message {
    color: #6B7280;
}

/* Notification Icon */
.notification-item .notif-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item .notif-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Notification Content */
.notification-item .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-item .notif-message {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    line-height: 1.5;
}

.notification-item .notif-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.notification-item .notif-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

.notification-item .notif-time .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.notification-item .notif-date {
    font-size: 12px;
    color: #9CA3AF;
}

/* Notification Actions */
.notification-item .notif-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notification-item .mark-read-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #10B981;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.notification-item .mark-read-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.notification-item .mark-read-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.notification-item .read-indicator {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #D1FAE5;
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-item .read-indicator .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Pagination */
.hrm-notif-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.hrm-notif-pagination .page-info {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

.hrm-notif-pagination .page-buttons {
    display: flex;
    gap: 8px;
}

.hrm-notif-pagination .page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.hrm-notif-pagination .page-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.hrm-notif-pagination .page-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Sidebar Navigation Badge */
.nav-notif-badge {
    display: none;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #EF4444;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hrm-tab-btn .nav-notif-badge[style*="display: flex"],
.hrm-tab-btn .nav-notif-badge:not([style*="display: none"]):not(:empty) {
    display: flex;
}

/* Dashboard Notifications List Box Enhanced */
.hrm-notifications-list-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #E5E7EB;
}

.hrm-notifications-list-box .notif-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hrm-notifications-list-box .notif-box-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.hrm-notifications-list-box .notif-box-header h3 .dashicons {
    color: var(--primary-color);
}

.hrm-notifications-list-box .unread-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.hrm-notifications-list-box .hrm-notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hrm-notifications-list-box .hrm-notif-list li {
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.hrm-notifications-list-box .hrm-notif-list li:last-child {
    border-bottom: none;
}

.hrm-notifications-list-box .hrm-notif-list li.unread {
    padding-left: 12px;
    border-left: 3px solid #F59E0B;
    background: #FFFBEB;
    margin: 0 -12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.hrm-notifications-list-box .hrm-notif-list li.unread:last-child {
    margin-bottom: 0;
}

.hrm-notifications-list-box .hrm-notif-list li p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #374151;
}

.hrm-notifications-list-box .hrm-notif-list li small {
    font-size: 12px;
    color: #9CA3AF;
}

.hrm-notifications-list-box .notif-box-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #F3F4F6;
    text-align: center;
}

/* View All Notifications Button - Standard HRMS Styling */
.hrm-notifications-list-box .notif-box-footer .hrm-btn-view-all-notifs {
    background: var(--hrm-gradient) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 4px rgba(12, 135, 118, 0.2) !important;
}

.hrm-notifications-list-box .notif-box-footer .hrm-btn-view-all-notifs:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(12, 135, 118, 0.3) !important;
    filter: brightness(1.05) !important;
}

.hrm-notifications-list-box .notif-box-footer .hrm-btn-view-all-notifs:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(12, 135, 118, 0.2) !important;
}

.hrm-notifications-list-box .no-notifs {
    text-align: center;
    color: #9CA3AF;
    font-size: 14px;
    padding: 20px 0;
}

/* Link Button */
.hrm-btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.hrm-btn-link:hover {
    background: #E0F2F1;
    color: var(--primary-hover);
}

/* ===== Company Policies Module - Employee View ===== */

.hrm-policies-section {
    padding: 0;
}

.hrm-policies-section .hrm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.hrm-policies-section .hrm-section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

/* Filter Chips */
.hrm-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hrm-filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    color: #6B7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hrm-filter-chip:hover {
    background: #E5E7EB;
    color: #374151;
}

.hrm-filter-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Policies Grid */
.hrm-policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Policy Card */
.hrm-policy-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #F3F4F6;
    overflow: hidden;
    transition: all 0.2s ease;
}

.hrm-policy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.policy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0;
}

.policy-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(12, 135, 118, 0.15) 0%, rgba(6, 78, 76, 0.15) 100%);
}

.policy-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.policy-card-body {
    padding: 20px;
}

.policy-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
    line-height: 1.3;
}

.policy-description {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
}

.policy-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9CA3AF;
}

.policy-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.policy-card-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #F3F4F6;
    background: #FAFAFA;
}

.policy-card-footer .hrm-btn-sm {
    flex: 1;
    justify-content: center;
}

/* Category Badges (Frontend) */
.hrm-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrm-category-general {
    background: rgba(12, 135, 118, 0.1);
    color: var(--primary-color);
}

.hrm-category-hr {
    background: rgba(236, 72, 153, 0.1);
    color: #DB2777;
}

.hrm-category-it {
    background: rgba(6, 182, 212, 0.1);
    color: #0891B2;
}

.hrm-category-finance {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.hrm-category-safety {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.hrm-category-compliance {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.hrm-category-other {
    background: var(--bg-body);
    color: var(--text-secondary);
}

/* Small Buttons */
.hrm-btn-sm {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: none;
}

.hrm-btn-sm .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.hrm-btn-outline-primary {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.hrm-btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Frontend Modal Adjustments */
.hrm-frontend-modal .hrm-modal-content {
    margin: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* ===== Policy Detail Modal - Clean Focused Layout ===== */
#hrm-policy-detail-modal {
    isolation: isolate;
}

#hrm-policy-detail-modal .hrm-modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
}

/* Policy modal header with gradient */
#hrm-policy-detail-modal .hrm-modal-header-premium {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--hrm-gradient);
    border-radius: 16px 16px 0 0;
    position: relative;
}

#hrm-policy-detail-modal .header-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#hrm-policy-detail-modal .header-icon-wrapper .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

#hrm-policy-detail-modal .header-text {
    flex: 1;
}

#hrm-policy-detail-modal .header-text h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

#hrm-policy-detail-modal .header-text p {
    margin: 0;
}

/* Policy modal body styling */
#hrm-policy-detail-modal .hrm-modal-body-premium {
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 24px;
}

/* Policy Modal Header Icon */
#hrm-policy-detail-modal .header-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Policy Detail Meta */
.policy-detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
}

.policy-detail-meta .dashicons {
    color: var(--text-secondary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.policy-detail-meta .meta-label {
    color: var(--text-main);
    font-weight: 500;
}

.policy-detail-meta .meta-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* Policy Detail Content */
.policy-detail-content {
    margin-bottom: 24px;
}

.policy-detail-content .section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.policy-description-box {
    background: var(--bg-body);
    padding: 16px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
}

/* When policy modal is open, ensure clean background */
body.hrm-modal-open #hrm-policy-detail-modal {
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Responsive */
@media (max-width: 768px) {
    .hrm-policies-grid {
        grid-template-columns: 1fr;
    }

    .hrm-filter-chips {
        overflow-x: auto;
        padding-bottom: 8px;
        flex-wrap: nowrap;
    }

    .hrm-filter-chip {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ============================================================================
   PAGINATION (Frontend / Employee Portal)
   ============================================================================ */

.hrm-pagination-wrapper {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.hrm-pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

/* Size - Order 1 (Left) */
.hrm-page-size-wrapper {
    order: 1;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.hrm-page-size-select {
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-body) url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8"%3e%3cpath fill="%236B7280" d="M6 8L0 0h12z"/%3e%3c/svg%3e') no-repeat right 8px center;
    appearance: none;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    line-height: 1.5;
}

/* Controls - Order 2 (Center) */
.hrm-pagination-controls {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.hrm-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    text-decoration: none;
    line-height: normal;
}

.hrm-pagination-btn:hover:not(:disabled) {
    background: var(--bg-body);
    color: var(--text-main);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.hrm-pagination-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.hrm-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Info - Order 3 (Right) */
.hrm-pagination-info {
    order: 3;
    flex: 0 0 auto;
    text-align: right;
    font-size: 14px;
    color: var(--text-secondary);
}

.hrm-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hrm-pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .hrm-pagination-row {
        flex-direction: column;
        justify-content: center;
    }

    .hrm-page-size-wrapper,
    .hrm-pagination-info {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hrm-pagination-controls {
        order: 1;
        width: 100%;
        margin-bottom: 8px;
    }

    .hrm-page-size-wrapper {
        order: 2;
    }

    .hrm-pagination-info {
        order: 3;
    }

    .hrm-pg-prev .btn-text,
    .hrm-pg-next .btn-text {
        display: none;
    }
}

/* ============================================================================
   PAYROLL MODULE - EMPLOYEE PORTAL VIEW
   ============================================================================ */

/* Payroll Section Container */
#payroll .hrm-card {
    background: #FFFFFF;
    border-radius: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    overflow: hidden;
    animation: payrollFadeIn 0.4s ease-out;
}

@keyframes payrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Payroll Card Header */
#payroll .hrm-card-header {
    padding: 24px 28px;
    border-bottom: 1px solid #F3F4F6;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
}

#payroll .hrm-card-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px 0;
}

#payroll .hrm-card-header h3 .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

#payroll .hrm-card-header p {
    margin: 0;
    font-size: 14px;
    color: #6B7280;
}

/* Payroll Card Body */
#payroll .hrm-card-body {
    padding: 0;
}

/* Payroll Table Enhancement */
#payroll .hrm-table {
    width: 100%;
    border-collapse: collapse;
}

#payroll .hrm-table thead {
    background: linear-gradient(180deg, #F9FAFB 0%, #F3F4F6 100%);
    border-bottom: 2px solid #E5E7EB;
}

#payroll .hrm-table thead th {
    padding: 16px 24px;
    font-size: 11px;
    font-weight: 800;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
}

#payroll .hrm-table tbody tr {
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.2s ease;
}

#payroll .hrm-table tbody tr:last-child {
    border-bottom: none;
}

#payroll .hrm-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(12, 135, 118, 0.03) 0%, transparent 100%);
}

#payroll .hrm-table tbody td {
    padding: 18px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    vertical-align: middle;
}

/* Payroll Table Strong Elements */
#payroll .hrm-table tbody td strong {
    font-weight: 700;
    color: #111827;
}

/* Payroll Button Styling */
#payroll .hrm-payroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
}

#payroll .hrm-payroll-btn-primary {
    background: linear-gradient(135deg, #0C8776 0%, #10B981 100%);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(12, 135, 118, 0.35);
}

#payroll .hrm-payroll-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(12, 135, 118, 0.45);
    filter: brightness(1.05);
}

#payroll .hrm-payroll-btn-primary .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Payroll Actions Flex */
#payroll .hrm-actions-flex {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Empty State for Payroll */
#payroll .hrm-table tbody td[colspan] {
    text-align: center;
    padding: 50px 24px;
    color: #6B7280;
    font-size: 15px;
}

/* Payslip Modal Enhancement */
#hrm-payslip-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

#hrm-payslip-modal .hrm-modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    animation: payslipModalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 100%;
}

@keyframes payslipModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#hrm-payslip-modal .hrm-payslip-container {
    max-width: 900px;
}

/* Payslip Modal Header */
#hrm-payslip-modal .hrm-modal-header-premium {
    padding: 24px 28px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

#hrm-payslip-modal .header-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0C8776 0%, #10B981 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 16px -4px rgba(12, 135, 118, 0.4);
    flex-shrink: 0;
}

#hrm-payslip-modal .header-icon-wrapper .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

#hrm-payslip-modal .header-text {
    flex: 1;
}

#hrm-payslip-modal .header-text h2 {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 4px 0;
}

#hrm-payslip-modal .header-text p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

#hrm-payslip-modal .header-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

#hrm-payslip-modal .hrm-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#hrm-payslip-modal .hrm-btn-outline:hover {
    background: #F9FAFB;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#hrm-payslip-modal .hrm-btn-outline .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

#hrm-payslip-modal .hrm-modal-close-premium {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F1F5F9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6B7280;
}

#hrm-payslip-modal .hrm-modal-close-premium:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

/* Payslip Content */
#hrm-payslip-modal .payslip-inner {
    padding: 40px;
}

#hrm-payslip-modal .payslip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #E5E7EB;
}

#hrm-payslip-modal .payslip-header .payslip-title h3 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

#hrm-payslip-modal .payslip-employee-info {
    display: flex;
    justify-content: space-between;
    background: #F8FAFC;
    padding: 25px;
    border-radius: 14px;
    border: 1px solid #E2E8F0;
    margin-bottom: 40px;
}

#hrm-payslip-modal .payslip-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

#hrm-payslip-modal .payslip-body h4 {
    font-size: 14px;
    font-weight: 800;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #E5E7EB;
}

#hrm-payslip-modal .payslip-table {
    width: 100%;
    border-collapse: collapse;
}

#hrm-payslip-modal .payslip-table tr {
    border-bottom: 1px solid #F3F4F6;
}

#hrm-payslip-modal .payslip-table td {
    padding: 12px 0;
    font-size: 14px;
    color: #374151;
}

#hrm-payslip-modal .payslip-table .payslip-total-row {
    border-top: 2px solid #E5E7EB;
    border-bottom: none;
}

#hrm-payslip-modal .payslip-table .payslip-total-row td {
    font-weight: 800;
    font-size: 15px;
    padding-top: 16px;
    color: #111827;
}

/* Net Salary Highlight Box */
#hrm-payslip-modal .net-salary-highlight {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0C8776 0%, #10B981 100%);
    padding: 24px 32px;
    border-radius: 16px;
    color: white;
    margin-top: 24px;
    box-shadow: 0 10px 25px -5px rgba(12, 135, 118, 0.3);
}

#hrm-payslip-modal .net-salary-highlight span {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

#hrm-payslip-modal .net-salary-highlight strong {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Payroll Status Badges */
#payroll .hrm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    line-height: 1;
}

#payroll .hrm-badge-success,
#hrm-payslip-modal .hrm-badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

#payroll .hrm-badge-warning,
#hrm-payslip-modal .hrm-badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

#payroll .hrm-badge-neutral,
#hrm-payslip-modal .hrm-badge-neutral {
    background: #F1F5F9;
    color: #6B7280;
}

/* Payroll Responsive */
@media (max-width: 768px) {
    #payroll .hrm-card-header {
        padding: 20px;
    }

    #payroll .hrm-card-header h3 {
        font-size: 18px;
    }

    #payroll .hrm-table thead th,
    #payroll .hrm-table tbody td {
        padding: 14px 16px;
    }

    #hrm-payslip-modal .payslip-inner {
        padding: 24px;
    }

    #hrm-payslip-modal .payslip-body {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    #hrm-payslip-modal .net-salary-highlight {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 20px;
    }

    #hrm-payslip-modal .net-salary-highlight strong {
        font-size: 28px;
    }

    #hrm-payslip-modal .header-actions {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    #payroll .hrm-payroll-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    #payroll .hrm-payroll-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
}

/* Print Styles for Payslip */
@media print {

    #hrm-payslip-modal .no-print,
    #hrm-payslip-modal .hrm-modal-header-premium {
        display: none !important;
    }

    #hrm-payslip-modal {
        position: static;
        background: none;
        padding: 0;
    }

    #hrm-payslip-modal .hrm-modal-content {
        max-height: none;
        box-shadow: none;
    }

    #hrm-payslip-modal .payslip-inner {
        padding: 20px 0;
    }

    #hrm-payslip-modal .net-salary-highlight {
        background: #0C8776 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
/* ==========================================
   PORTAL RESPONSIVE ENHANCEMENTS
   ========================================== */

@media (max-width: 1024px) {
    .hrm-portal-wrap {
        flex-direction: column;
        padding: 16px;
        gap: 24px;
    }

    .hrm-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 20px;
        border-radius: 16px;
    }

    .hrm-sidebar-header {
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid #F1F5F9;
    }

    .hrm-nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hrm-tab-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .hrm-nav-section {
        margin-bottom: 16px;
        width: 100%;
    }
    
    .hrm-nav-scroll {
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .hrm-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .hrm-hero-section {
        height: auto;
        padding: 32px 24px;
    }

    .hrm-hero-section h1 {
        font-size: 24px;
    }

    .hrm-timer-wrapper {
        width: 240px;
        height: 240px;
    }

    .hrm-timer-bg {
        font-size: 48px;
    }

    .hrm-attendance-hero {
        padding: 32px 20px;
    }
    
    .hrm-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

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

    .hrm-nav-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .hrm-tab-btn {
        min-width: 0;
        font-size: 13px;
        padding: 8px;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .hrm-tab-btn .dashicons {
        font-size: 20px;
    }
    
    .hrm-hero-section {
        padding: 24px 16px;
        text-align: center;
    }
}
