/* 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;
    /* Teal 600 */
    --primary-hover: #064E4C;
    /* Teal 800 */
    --secondary-color: #10B981;
    /* Emerald 500 */
    --danger-color: #EF4444;
    /* Red 500 */
    --warning-color: #F59E0B;
    /* Amber 500 */

    /* Gradients */
    --hrm-gradient: linear-gradient(135deg, #064E4C 0%, #0C8776 100%);
    /* Teal Gradient */
    --hrm-gradient-hover: linear-gradient(135deg, #0C8776 0%, #064E4C 100%);

    /* Neutrals */
    --bg-body: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    /* Gray 900 */
    --text-secondary: #6B7280;
    /* Gray 500 */
    --border-color: #E5E7EB;
    /* Gray 200 */

    /* 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Portal Wrapper --- */
.hrm-portal-wrap {
    max-width: 1000px;
    margin: 40px auto;
    padding: 32px;
    background: #064E4C;
    /* Fallback */
    background: var(--hrm-gradient);
    min-height: calc(100vh - 100px);
    border-radius: var(--radius-lg);
}

.hrm-portal-header {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #ffffff, #f9fafb);
}

.hrm-portal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* --- Tabs --- */
.hrm-tabs {
    display: inline-flex;
    padding: 6px;
    background: #E5E7EB;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    gap: 4px;
}

.hrm-tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.hrm-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.5);
}

.hrm-tab-btn.active {
    color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

/* --- Content Cards --- */
.hrm-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.hrm-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hrm-attendance-box,
.hrm-progress-box,
.hrm-tasks-list,
.hrm-profile-box,
.hrm-card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hrm-attendance-box h3,
.hrm-progress-box h3,
.hrm-tasks-list h3,
.hrm-profile-box h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 2px solid var(--bg-body);
    padding-bottom: 16px;
}

/* --- Status Badges --- */
.hrm-status-display {
    font-size: 1.1rem;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hrm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hrm-badge svg {
    width: 16px;
    height: 16px;
}

.hrm-badge.present {
    background: #D1FAE5;
    color: #065F46;
}

.hrm-badge.absent {
    background: #FEE2E2;
    color: #991B1B;
}

.hrm-badge.late {
    background: #FEF3C7;
    color: #92400E;
}

.hrm-badge.early_leave {
    background: #E0E7FF;
    color: #3730A3;
}

.hrm-badge.pending {
    background: #F3F4F6;
    color: #4B5563;
}

.hrm-badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

/* --- Buttons --- */
.hrm-btn,
.hrm-btn-primary,
.hrm-btn-green,
.hrm-btn-red,
.hrm-btn-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.hrm-btn:hover,
.hrm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.hrm-btn:active {
    transform: translateY(0);
}

.hrm-btn-primary,
.hrm-btn-blue {
    background: #064E4C;
    /* Fallback */
    background: var(--hrm-gradient);
    color: white;
    border: none;
}

.hrm-btn-primary:hover,
.hrm-btn-blue:hover {
    background: var(--hrm-gradient-hover);
}

.hrm-btn-green {
    background: var(--secondary-color);
    color: white;
}

.hrm-btn-green:hover {
    background: #059669;
}

.hrm-btn-red {
    background: var(--danger-color);
    color: white;
}

.hrm-btn-red:hover {
    background: #DC2626;
}

.hrm-btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* --- Forms --- */
.hrm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hrm-form-grid .full-width {
    grid-column: 1 / -1;
}

.hrm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.hrm-form-group input,
.hrm-form-group select,
.hrm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: #F9FAFB;
    color: var(--text-main);
    box-sizing: border-box;
}

.hrm-form-group input:focus,
.hrm-form-group select:focus,
.hrm-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.hrm-form-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

/* --- Task List --- */
.hrm-tasks-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hrm-task-item {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.hrm-task-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.hrm-task-item.completed {
    background: #F9FAFB;
    border-style: dashed;
}

.hrm-task-item.completed .task-header strong {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-header strong {
    font-size: 1.1rem;
    color: var(--text-main);
}

.task-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
    height: 16px;
}

.hrm-badge.present {
    background: #D1FAE5;
    color: #065F46;
}

.hrm-badge.absent {
    background: #FEE2E2;
    color: #991B1B;
}

.hrm-badge.late {
    background: #FEF3C7;
    color: #92400E;
}

.hrm-badge.early_leave {
    background: #E0E7FF;
    color: #3730A3;
}

.hrm-badge.pending {
    background: #F3F4F6;
    color: #4B5563;
}

.hrm-badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

/* --- Buttons --- */
.hrm-btn,
.hrm-btn-primary,
.hrm-btn-green,
.hrm-btn-red,
.hrm-btn-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.hrm-btn:hover,
.hrm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.hrm-btn:active {
    transform: translateY(0);
}

.hrm-btn-primary,
.hrm-btn-blue {
    background: #064E4C;
    /* Fallback */
    background: var(--hrm-gradient);
    color: white;
    border: none;
}

.hrm-btn-primary:hover,
.hrm-btn-blue:hover {
    background: var(--hrm-gradient-hover);
}

.hrm-btn-green {
    background: var(--secondary-color);
    color: white;
}

.hrm-btn-green:hover {
    background: #059669;
}

.hrm-btn-red {
    background: var(--danger-color);
    color: white;
}

.hrm-btn-red:hover {
    background: #DC2626;
}

.hrm-btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* --- Forms --- */
.hrm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hrm-form-grid .full-width {
    grid-column: 1 / -1;
}

.hrm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.hrm-form-group input,
.hrm-form-group select,
.hrm-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: #F9FAFB;
    color: var(--text-main);
    box-sizing: border-box;
}

.hrm-form-group input:focus,
.hrm-form-group select:focus,
.hrm-form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.hrm-form-actions {
    margin-top: 32px;
    display: flex;
    justify-content: flex-end;
}

/* --- Task List --- */
.hrm-tasks-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hrm-task-item {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.hrm-task-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.hrm-task-item.completed {
    background: #F9FAFB;
    border-style: dashed;
}

.hrm-task-item.completed .task-header strong {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-header strong {
    font-size: 1.1rem;
    color: var(--text-main);
}

.task-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.task-meta {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Login Page --- */
.hrm-login-wrap {
    min-height: 100vh;
    justify-content: center;
    padding: 20px;
    background: var(--hrm-gradient);
    background-size: 200% 200%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hrm-login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 420px;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hrm-login-header {
    margin-bottom: 32px;
}

.hrm-login-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
}

.hrm-login-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
}

.hrm-login-form .hrm-form-group {
    margin-bottom: 20px;
    text-align: center;
}

.hrm-login-form label {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

.hrm-login-form input[type="text"],
.hrm-login-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #F9FAFB;
    color: var(--text-main);
    text-align: center;
}

.hrm-login-form input[type="text"]:focus,
.hrm-login-form input[type="password"]:focus {
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(12, 135, 118, 0.1);
    outline: none;
}

.hrm-remember-me {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    gap: 8px;
}

.hrm-remember-me label {
    display: block;
    font-weight: normal;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

.hrm-remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #D1D5DB;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin: 0;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 12px;
    background: var(--hrm-gradient);
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(12, 135, 118, 0.3);
}

.hrm-notice.success {
    background: #ECFDF5;
    color: #065F46;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #A7F3D0;
    font-weight: 500;
}

.hrm-login-error {
    background: #FEF2F2;
    color: #991B1B;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #FECACA;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hrm-form-grid {
        grid-template-columns: 1fr;
    }

    .hrm-portal-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .hrm-tabs {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}