:root {
    --primary-color: #8B1E1E;
    --secondary-color: #F4EBDD;
    --accent-color: #CFAE7B;
    --success-color: #22C55E;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --bg-color: #FAF7F2;
    --text-main: #333333;
    --text-muted: #6B7280;
    --card-bg: #FFFFFF;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(139, 30, 30, 0.1), 0 2px 4px -1px rgba(139, 30, 30, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(139, 30, 30, 0.1), 0 4px 6px -2px rgba(139, 30, 30, 0.05);
    
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

body {
    background-color: var(--bg-color);
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-main);
}

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-accent { background-color: var(--accent-color) !important; }

.text-primary { color: var(--primary-color) !important; }
.text-accent { color: var(--accent-color) !important; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: #6d1717;
    border-color: #6d1717;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    border-radius: var(--radius-md);
}
.btn-accent:hover {
    background-color: #b99863;
    border-color: #b99863;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="2" fill="%238B1E1E" fill-opacity="0.1"/></svg>');
    opacity: 0.5;
    z-index: 0;
}
.login-card {
    display: flex;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    max-width: 1000px;
    width: 100%;
    margin: 2rem;
    position: relative;
    z-index: 1;
    background: #fff;
}
.login-illustration {
    flex: 1;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.login-illustration img {
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
}
.login-form-area {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-control {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(139, 30, 30, 0.25);
    background-color: #fff;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid rgba(0,0,0,0.05);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1rem 0.75rem;
    z-index: 1000;
    overflow-y: auto;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    padding: 0 10px;
}
.sidebar-logo h4 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}
.sidebar-logo img {
    height: 40px;
}
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.sidebar-menu li a i {
    font-size: 1.2rem;
}

/* Sidebar Dropdown */
.sidebar-dropdown {
    position: relative;
}
.sidebar-dropdown > a.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}
.sidebar-dropdown > a.dropdown-toggle:hover,
.sidebar-dropdown > a.dropdown-toggle.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.sidebar-dropdown > a.dropdown-toggle .dropdown-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}
.sidebar-dropdown > a.dropdown-toggle[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}
.sidebar-dropdown > a.dropdown-toggle::after {
    display: none !important;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 44px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 1px;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.85rem;
}
.sidebar-submenu li a:hover,
.sidebar-submenu li a.active {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.sidebar-submenu li a i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Collapse animation */
.collapse:not(.show) {
    display: none;
}
.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.show {
    display: block;
    opacity: 1;
}
.sidebar-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.sidebar-close-btn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
body.sidebar-open {
    overflow: hidden;
}

/* ============================================ */
/* DASHBOARD KARYAWAN (Mobile-First) */
/* ============================================ */

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a52a2a 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.welcome-banner .welcome-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.welcome-banner .welcome-sub {
    font-size: 0.85rem;
    opacity: 0.85;
}
.welcome-banner .welcome-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

/* Logout Button inside Welcome Banner */
.btn-logout-banner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}
.btn-logout-banner:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
    transform: scale(1.1);
}
.btn-logout-banner:active {
    transform: scale(0.95);
}

/* Status Absen */
.status-absen-box {
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.status-absen-box.absent {
    background: linear-gradient(135deg, #FEE2E2, #FEF2F2);
    border: 1px solid #FECACA;
}
.status-absen-box.present {
    background: linear-gradient(135deg, #DCFCE7, #F0FDF4);
    border: 1px solid #BBF7D0;
}
.status-absen-box .status-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.status-absen-box.absent .status-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}
.status-absen-box.present .status-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
}

/* Ringkasan Kehadiran */
.ringkasan-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.ringkasan-card .progress-ringkasan {
    height: 8px;
    border-radius: 10px;
    background: #f3f4f6;
    overflow: hidden;
}
.ringkasan-card .progress-ringkasan .progress-bar-ringkasan {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--success-color), #4ADE80);
    transition: width 0.8s ease;
}

/* ============================================ */
/* MENU GRID 2x3 - Vertical Icon Layout        */
/* ============================================ */
.menu-grid-2x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.menu-grid-2x3 .menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4rem;
    background: #fff;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.menu-grid-2x3 .menu-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.4));
    pointer-events: none;
}

.menu-grid-2x3 .menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.06);
}

.menu-grid-2x3 .menu-card:active {
    transform: translateY(0px) scale(0.98);
}

/* Icon Wrap - Compact & Dominant */
.menu-grid-2x3 .menu-card .menu-card-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-bottom: 0.15rem;
}

.menu-grid-2x3 .menu-card .menu-lucide-icon {
    width: 40px;
    height: 40px;
    stroke-width: 2.5;
    transition: all 0.3s ease;
}

/* Card Title & Desc - Center Text */
.menu-grid-2x3 .menu-card .menu-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.2;
    text-align: center;
}

.menu-grid-2x3 .menu-card .menu-card-desc {
    font-size: 0.62rem;
    color: #9CA3AF;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}

/* ============================================ */
/* ANIMASI HOVER - Micro Interactions (ONLY ON HOVER/ACTIVE) */
/* ============================================ */
/* Semua animasi infinite dihapus. Animasi hanya aktif saat :hover atau :active */

/* Pulse Animation untuk Absen Sekarang (fingerprint) */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.menu-grid-2x3 .menu-card[data-anim="pulse-icon"]:hover .menu-lucide-icon,
.menu-grid-2x3 .menu-card[data-anim="pulse-icon"]:active .menu-lucide-icon {
    animation: pulse 0.6s ease-in-out;
    color: #EF4444;
}

/* Scale Animation untuk Klaim Lembur (clock-plus) */
@keyframes clock-spin {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-8deg); }
    50% { transform: scale(1.25) rotate(0deg); }
    75% { transform: scale(1.2) rotate(8deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.menu-grid-2x3 .menu-card[data-anim="scale-icon"]:hover .menu-lucide-icon,
.menu-grid-2x3 .menu-card[data-anim="scale-icon"]:active .menu-lucide-icon {
    animation: clock-spin 0.6s ease-in-out;
    color: #F59E0B;
}

/* Wiggle Animation untuk Slip Gaji (wallet) */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(8deg); }
    60% { transform: rotate(-5deg); }
    80% { transform: rotate(5deg); }
}

.menu-grid-2x3 .menu-card[data-anim="wiggle-icon"]:hover .menu-lucide-icon,
.menu-grid-2x3 .menu-card[data-anim="wiggle-icon"]:active .menu-lucide-icon {
    animation: wiggle 0.5s ease-in-out;
    color: #14B8A6;
}

/* Pop-up Smooth untuk menu lainnya */
.menu-grid-2x3 .menu-card[data-anim="pop"]:hover,
.menu-grid-2x3 .menu-card[data-anim="pop"]:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08), 0 3px 10px rgba(0,0,0,0.05);
}

.menu-grid-2x3 .menu-card[data-anim="pop"]:hover .menu-card-icon-wrap,
.menu-grid-2x3 .menu-card[data-anim="pop"]:active .menu-card-icon-wrap {
    transform: scale(1.05);
}

/* Shift Card */
.shift-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-color);
}
.shift-card .shift-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}
.shift-card .shift-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================ */
/* DASHBOARD ADMIN / HRD */
/* ============================================ */

/* Top Stats Badges */
.stat-badge-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: none;
}
.stat-badge-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-badge-card .stat-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-badge-card .stat-badge-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-badge-card .stat-badge-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.quick-actions-grid .quick-action-item {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.1rem 0.75rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}
.quick-actions-grid .quick-action-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.quick-actions-grid .quick-action-item .qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 0.5rem;
}
.quick-actions-grid .quick-action-item .qa-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

/* Pending Approvals */
.pending-approval-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.pending-approval-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.pending-approval-item .pa-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.pending-approval-item .pa-info {
    flex: 1;
    min-width: 0;
}
.pending-approval-item .pa-info .pa-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}
.pending-approval-item .pa-info .pa-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pending-approval-item .pa-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
.pending-approval-item .pa-actions .btn-pa {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    border: none;
    transition: all 0.2s ease;
}
.pending-approval-item .pa-actions .btn-pa.approve {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-color);
}
.pending-approval-item .pa-actions .btn-pa.approve:hover {
    background: var(--success-color);
    color: #fff;
}
.pending-approval-item .pa-actions .btn-pa.reject {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-color);
}
.pending-approval-item .pa-actions .btn-pa.reject:hover {
    background: var(--danger-color);
    color: #fff;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .login-card { flex-direction: column; }
    .login-illustration { display: none; }
    .login-form-area { padding: 2rem; }
    
    .main-content {
        padding: 1rem;
    }
    .topbar {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    .topbar h5 {
        font-size: 1rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
    .quick-actions-grid .quick-action-item {
        padding: 0.9rem 0.5rem;
    }
    .quick-actions-grid .quick-action-item .qa-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    .quick-actions-grid .quick-action-item .qa-label {
        font-size: 0.72rem;
    }
    
    .welcome-banner {
        padding: 1.1rem;
    }
    .welcome-banner .welcome-text {
        font-size: 1rem;
    }
    .welcome-banner .welcome-avatar {
        width: 42px;
        height: 42px;
    }
    
    .stat-badge-card .stat-badge-value {
        font-size: 1.3rem;
    }
    .stat-badge-card .stat-badge-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .shift-card .shift-time {
        font-size: 1.2rem;
    }
}

@media (min-width: 769px) {
    .quick-actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   NOTIFICATION BELL - Dinamis & Clickable
   ========================================== */
.notification-bell {
    position: relative;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: transparent;
}

.notification-bell:hover {
    transform: scale(1.1);
    background: rgba(139, 30, 30, 0.08);
}

.notification-bell:hover i {
    color: var(--primary-color) !important;
}

.notification-badge {
    animation: notif-pulse 2s infinite;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
}

@keyframes notif-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}
