/* ============================================================
   Paycheck / Pay Stub Breakdown Styles
   Table-style worksheet layout
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #e8e8e8;
    color: #000;
    margin: 0;
    padding: 0;
}

/* Webpage Header (matching other pages) */
.page-header {
    background: #fff;
    border-bottom: 3px solid #01887c;
    padding: 0;
    margin: 0;
}

.page-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
}

.nav-back {
    display: inline-block;
    color: #01887c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-back:hover {
    color: #016961;
    text-decoration: underline;
}

/* Paycheck Container */
.paycheck-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px 40px;
}

/* Header */
.paycheck-header {
    background: #fff;
    padding: 30px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.paycheck-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #01887c;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Pay Section */
.pay-section {
    background: #fff;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #01887c;
}

.section-note {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    padding: 10px;
    background: #f0f8ff;
    border-left: 3px solid #01887c;
}

/* Pay Table */
.pay-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.pay-table thead {
    background: #f5f5f5;
}

.pay-table th {
    padding: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border: 1px solid #ddd;
}

.pay-table td {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
}

.pay-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.pay-table tbody tr:hover {
    background: #f0faf9;
}

.amount-col {
    width: 180px;
    text-align: right;
}

.percent-col {
    width: 120px;
    text-align: right;
}

/* Input Fields */
.amount-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.amount-input:focus {
    outline: none;
    border-color: #01887c;
    background: #f0faf9;
}

.amount-input:invalid {
    border-color: #c62828;
}

/* Percent Display */
.percent-display {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #01887c;
}

/* Add Row Section */
.add-row-section {
    margin-top: 15px;
    text-align: center;
}

.btn-add {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: #01887c;
    border: 2px solid #01887c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #01887c;
    color: #fff;
}

/* Custom Deduction Row */
.custom-deduction-row {
    background: #fff9e6 !important;
}

.custom-deduction-row td {
    border-color: #ffa726;
}

.custom-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn-remove {
    padding: 5px 12px;
    font-size: 12px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #b71c1c;
}

/* Totals Section */
.totals-section {
    background: #f0faf9;
    border: 2px solid #01887c;
}

.totals-table tbody tr {
    background: transparent !important;
}

.total-amount {
    font-size: 16px;
    font-weight: 700;
    color: #01887c;
    font-family: 'Courier New', monospace;
}

.net-pay-row {
    background: #01887c !important;
}

.net-pay-row td {
    color: #fff;
    font-size: 18px;
    padding: 15px 12px;
}

.net-pay {
    color: #fff !important;
}

/* Action Section */
.action-section {
    text-align: center;
    padding: 30px 0;
}

.btn-reset {
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset:hover {
    background: #b71c1c;
}

.btn-reset:active {
    background: #a71c1c;
}

/* Responsive */
@media (max-width: 768px) {
    .paycheck-container {
        padding: 0 10px 30px;
    }

    .paycheck-header {
        padding: 20px;
    }

    .paycheck-header h1 {
        font-size: 22px;
    }

    .pay-section {
        padding: 15px;
    }

    .pay-table {
        font-size: 12px;
    }

    .pay-table th,
    .pay-table td {
        padding: 8px;
    }

    .amount-col {
        width: 120px;
    }

    .percent-col {
        width: 80px;
    }

    .amount-input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

@media print {
    .page-header,
    .add-row-section,
    .action-section,
    .btn-remove {
        display: none;
    }

    .paycheck-container {
        max-width: 100%;
    }

    .pay-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
