body {
    background-color: #f8fafc;
    color: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03), 0 0 3px rgba(0,0,0,0.02);
}

.metric-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.08);
}

.metric-card:hover::before {
    transform: translateX(100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}
.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-item {
    transition: all 0.2s;
    position: relative;
}
.nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-right: 3px solid #8b5cf6;
    font-weight: 600;
}

input, select {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(203, 213, 225, 1) !important;
    color: #0f172a !important;
    transition: all 0.3s ease;
}
input:focus, select:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
    outline: none !important;
}

.table-container {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 1);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #334155;
}

tr:hover td {
    background: #f8fafc;
}

.gradient-text {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    transition: all 0.3s ease;
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-income { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-expense { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Loading Overlay */
#loading-overlay {
    transition: opacity 0.3s ease;
}
#loading-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* Print Styles — Payslip Only */
@media print {
    /* Hide everything by default */
    body {
        background: white !important;
        background-image: none !important;
    }

    aside,
    .nav-item,
    #loading-overlay,
    .no-print,
    button,
    form,
    .glass-panel:not(.payslip-card) {
        display: none !important;
    }

    /* Show payslip tab content */
    .tab-content {
        display: none !important;
    }
    #tab-payslip {
        display: block !important;
    }

    /* Hide payslip header/controls area (the generation form panel) */
    #tab-payslip > .glass-panel:first-child {
        display: none !important;
    }

    /* Show payslip cards */
    .payslip-card {
        display: block !important;
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #e2e8f0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        background: white !important;
        margin-bottom: 24px;
        padding: 24px !important;
    }

    /* When .print-target exists, hide all others */
    #payslip-container:has(.print-target) .payslip-card:not(.print-target) {
        display: none !important;
    }

    /* Hide action buttons / checkboxes inside payslip for print */
    .payslip-card button,
    .payslip-card .advance-checkbox,
    .payslip-card .advance-deduction-input {
        display: none !important;
    }

    /* Main content fills the page */
    main {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #payslip-container {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Trip attachment file input */
input[type="file"] {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(203, 213, 225, 1) !important;
    cursor: pointer;
}

/* Trip table compact */
#table-triplogs th,
#table-triplogs td {
    padding: 0.65rem 0.5rem;
    font-size: 0.8rem;
}
