/* Custom HR Frontend - Frontend Dashboard Styles */

:root {
    --primary-color: #1d268d;
    --primary-light: #2c2ebb;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
}

/* Login Required / Not Found / Access Denied Cards */
.emp-login-required,
.emp-not-found,
.hr-login-required,
.hr-access-denied {
    text-align: center;
    padding: 80px 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    max-width: 540px;
    margin: 80px auto;
    animation: empFadeInUp 0.6s ease-out;
}

.emp-login-required p,
.emp-not-found p,
.hr-login-required p,
.hr-access-denied p {
    color: #64748b;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 400;
}

@keyframes empFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Container */
.custom-hr-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 0;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.user-details h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.user-details p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-light);
}

/* Overview Cards */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.overview-card {
    background: white;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.overview-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-icon.purple {
    background: #f3f0ff;
    color: var(--primary-color);
}

.card-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.card-icon.green {
    background: #dcfce7;
    color: var(--success-color);
}

.card-icon.orange {
    background: #fed7aa;
    color: var(--warning-color);
}

.card-title {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

/* Widgets */
.dashboard-widget {
    background: white;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.widget-action {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.widget-action:hover {
    text-decoration: underline;
}

/* Attendance Widget */
.attendance-clock {
    text-align: center;
    padding: 30px;
}

.clock-time {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.clock-date {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.attendance-status {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.status-item {
    text-align: center;
}

.status-label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-bottom: 5px;
}

.status-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Check-in Button */
.btn-checkin {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 0;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-checkin:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.btn-checkin:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Announcements */
.announcements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.announcement-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.announcement-item:hover {
    background: var(--bg-light);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.announcement-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.announcement-time {
    font-size: 12px;
    color: var(--text-light);
}

.announcement-content {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

/* People Status */
.people-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-box {
    text-align: center;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 0;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Who is Out */
.out-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.out-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

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

.out-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 0;
    object-fit: cover;
}

.out-details {
    flex: 1;
}

.out-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.out-dates {
    font-size: 12px;
    color: var(--text-light);
}

.out-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 0;
    background: #fef3c7;
    color: #92400e;
    font-weight: 500;
}

/* Edit Mode Styles */
.hr-input-mini {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
    background: #fff;
    color: var(--text-dark);
}

.hr-input-mini:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(88, 67, 190, 0.1);
}

.hr-banner-info .hr-input-mini {
    max-width: 400px;
    font-size: 18px;
    margin-bottom: 5px;
}

.hr-btn-banner-action.btn-save-profile {
    background-color: var(--success-color);
}

.hr-btn-banner-action.btn-save-profile:hover {
    background-color: #16a34a;
}

.hr-btn-banner-action.btn-cancel-edit {
    background-color: #94a3b8;
}

.hr-btn-banner-action.btn-cancel-edit:hover {
    background-color: #64748b;
}

/* Ensure view-val and edit-val are handled correctly if JS fails slightly */
.hr-employee-detail-v3:not(.hr-edit-mode) .edit-val {
    display: none !important;
}

.hr-employee-detail-v3.hr-edit-mode .view-val {
    display: none !important;
}

.hr-employee-detail-v3.hr-edit-mode .edit-val {
    display: inline-block !important;
}

.hr-banner-info .edit-val {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .custom-hr-dashboard {
        padding: 20px 15px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .people-stats {
        grid-template-columns: 1fr;
    }
}