:root {
    --border: #8c949f;
    --header: #e7eaee;
    --soft: #f5f5f5;
    --brand: #1f4f3a;
    --accent: #f7941d;
    --text: #1f2933;
    --font-ui: 'Segoe UI', Calibri, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    background: #eef1f4;
    color: var(--text);
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 24px;
    padding: 24px;
    align-items: start;
}

.form-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: sticky;
    top: 16px;
}

.panel-header {
    padding: 20px 22px 8px;
}

.panel-header h1 {
    margin: 0 0 6px;
    font-size: 29px;
    font-weight: 700;
    letter-spacing: 0.2px;
    font-family: var(--font-ui);
}

.panel-header p {
    margin: 0;
    color: #58606a;
    font-size: 13px;
    line-height: 1.45;
    font-family: var(--font-ui);
}

.salary-form {
    padding: 12px 22px 22px;
}

.form-section {
    margin-bottom: 18px;
    border: 1px solid #d9dde3;
    border-radius: 12px;
    padding: 14px;
}

.form-section h2 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-family: var(--font-ui);
    color: #2c3a47;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid.two-col {
    grid-template-columns: 1fr 1fr;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-ui);
    color: #3d4852;
}

.full-width {
    grid-column: 1 / -1;
}

input {
    width: 100%;
    border: 1px solid #c9d0da;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-ui);
}

input:focus {
    outline: 2px solid rgba(29, 111, 66, 0.18);
    border-color: #4d8c6d;
}

input[readonly] {
    background: #f1f3f5;
    color: #4a5560;
    cursor: not-allowed;
}

.action-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-ui);
}

.primary-btn {
    background: #1d6f42;
    color: #fff;
}

.secondary-btn {
    background: #e6ebf0;
    color: #22303c;
}

.preview-panel {
    overflow-x: auto;
}

.salary-slip {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 1.5px solid var(--border);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.company-box {
    border-bottom: 1.5px solid var(--border);
}

.brand-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px 6px;
}

.brand-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.company-logo {
    display: block;
    width: auto;
    max-width: 360px;
    max-height: 82px;
    height: auto;
    object-fit: contain;
}

.company-name-text {
    font-family: var(--font-ui);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #18212b;
    text-align: center;
}

.company-meta {
    border-top: 1px solid #b2b8c0;
    text-align: center;
    padding: 7px 14px;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
    font-family: var(--font-ui);
}

.slip-title {
    background: linear-gradient(to bottom, #eceff3, #e1e6eb);
    border-top: 1.5px solid var(--border);
    border-bottom: 1.5px solid var(--border);
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.25px;
    padding: 8px 10px;
    font-family: var(--font-ui);
}

.info-table,
.salary-table {
    width: 100%;
    border-collapse: collapse;
}

.salary-table {
    table-layout: fixed;
}

.info-table td,
.salary-table th,
.salary-table td {
    border: 1px solid var(--border);
    padding: 6px 9px;
    font-size: 12.5px;
    line-height: 1.35;
    font-family: var(--font-ui);
}

.info-table td:nth-child(odd) {
    width: 22%;
    font-weight: 700;
    color: #243240;
    background: #fafbfc;
}

.info-table td:nth-child(even) {
    width: 28%;
    font-weight: 500;
}

.salary-table thead tr:first-child th,
.salary-table thead tr:last-child th {
    background: #e6eaef;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.salary-table thead tr:last-child th {
    font-size: 12.5px;
}

.text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.blank-area {
    background: #fafbfc;
}

.summary-row td {
    font-weight: 700;
    background: #f5f7fa;
}

.highlight-row td {
    background: #eef3f8;
}

#netPayWords {
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.45;
}

.footer-note {
    background: var(--header);
    border-top: 2px solid var(--border);
    text-align: center;
    padding: 22px 12px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-ui);
    color: #334152;
}

@media (max-width: 1024px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .form-panel {
        position: static;
    }
}

@media (max-width: 700px) {
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .company-logo {
        max-width: 260px;
        max-height: 62px;
    }

    .info-table td,
    .salary-table th,
    .salary-table td {
        font-size: 13px;
    }
}

@media print {
    body {
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .page-shell {
        display: block;
        padding: 0;
    }

    .salary-slip {
        border: 1px solid #7f8792;
        box-shadow: none;
        max-width: 100%;
    }

    .company-logo {
        max-height: 70px;
    }

    @page {
        size: A4;
        margin: 8mm;
    }
}
