/* ============================================
   Nush.ai HR — Payroll Page
   ============================================ */

/* ---- Payroll Summary ---- */

.payroll-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.payroll-summary-card {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.payroll-summary-card:hover {
    border-color: var(--border-default);
}

.payroll-summary-card__label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.payroll-summary-card__value {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.payroll-summary-card__value--earnings {
    color: var(--status-active);
}

.payroll-summary-card__value--deductions {
    color: var(--status-terminated);
}

.payroll-summary-card__value--net {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payroll-summary-card__change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
}

/* ---- Payroll Table ---- */

.payroll-table {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.payroll-table__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.payroll-table__title {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.payroll-table .table td.payroll-amount {
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-medium);
}

.payroll-amount--positive {
    color: var(--status-active);
}

.payroll-amount--negative {
    color: var(--status-terminated);
}

/* ---- Pay Stub ---- */

.pay-stub {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pay-stub__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.pay-stub__header-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.pay-stub__period {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.pay-stub__date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.pay-stub__net-pay {
    text-align: right;
}

.pay-stub__net-pay-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pay-stub__net-pay-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pay-stub__body {
    padding: var(--space-lg);
}

.pay-stub__section {
    margin-bottom: var(--space-lg);
}

.pay-stub__section:last-child {
    margin-bottom: 0;
}

.pay-stub__section-title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.pay-stub__line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    font-size: var(--text-sm);
}

.pay-stub__line-label {
    color: var(--text-secondary);
}

.pay-stub__line-value {
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.pay-stub__line--total {
    font-weight: var(--font-weight-semibold);
    padding-top: var(--space-sm);
    margin-top: var(--space-xs);
    border-top: 1px solid var(--border-default);
}

.pay-stub__line--total .pay-stub__line-label {
    color: var(--text-primary);
}

/* ---- Deduction Chart ---- */

.deduction-chart {
    margin-top: var(--space-lg);
}

.deduction-chart__title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.deduction-chart__bar {
    display: flex;
    height: 12px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-tertiary);
    margin-bottom: var(--space-md);
}

.deduction-chart__segment {
    height: 100%;
    transition: width var(--transition-slow);
}

.deduction-chart__segment--tax {
    background: var(--brand-purple);
}

.deduction-chart__segment--health {
    background: var(--brand-cyan);
}

.deduction-chart__segment--retirement {
    background: var(--brand-magenta);
}

.deduction-chart__segment--other {
    background: var(--status-on-leave);
}

.deduction-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.deduction-chart__legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.deduction-chart__legend-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.deduction-chart__legend-dot--tax {
    background: var(--brand-purple);
}

.deduction-chart__legend-dot--health {
    background: var(--brand-cyan);
}

.deduction-chart__legend-dot--retirement {
    background: var(--brand-magenta);
}

.deduction-chart__legend-dot--other {
    background: var(--status-on-leave);
}

/* ---- Payroll Columns ---- */

.payroll-columns {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-lg);
}

@media (max-width: 1280px) {
    .payroll-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .payroll-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .payroll-summary {
        grid-template-columns: 1fr;
    }

    .pay-stub__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .pay-stub__net-pay {
        text-align: left;
    }
}
