@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --ink: #17211b;
    --muted: #718078;
    --line: #dfe8df;
    --paper: #fff;
    --green: #287b54;
    --mint: #dff2e7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef4ef;
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    background: radial-gradient(circle at 95% 0%, #dcefe1 0, transparent 28%), #eef4ef;
}

.topbar {
    height: 76px;
    padding: 0 max(28px, calc((100% - 1240px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand strong,
h1,
h2 {
    font-family: 'Space Grotesk', sans-serif;
}

.brand strong {
    display: block;
    font-size: 19px;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
}

.topbar-meta {
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #3db477;
}

.payslip-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.dashboard {
    max-width: 1240px;
    padding: 52px 28px 30px;
    margin: auto;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.page-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 43px);
    letter-spacing: -1px;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.date-badge,
.record-count {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: rgba(255, 255, 255, .55);
    font-size: 12px;
}

.notice {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid #b9dfc6;
    border-radius: 5px;
    color: #236441;
    background: #eaf8ee;
    font-size: 13px;
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
}

.notice-dismiss {
    opacity: 0;
    transform: translateY(-6px);
}

.month-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.month-filter input {
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    background: var(--paper);
    font: inherit;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    min-height: 130px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
}

.metric-card.accent {
    color: #fff;
    border-color: var(--green);
    background: var(--green);
}

.metric-label,
.metric-note {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.accent .metric-label,
.accent .metric-note {
    color: #c7e4d2;
}

.metric-card strong {
    display: block;
    margin: 14px 0 3px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(300px, 370px) 1fr;
    gap: 20px;
    align-items: start;
}

.panel {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 10px 30px rgba(40, 76, 53, .05);
}

.panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 21px;
}

.panel-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--green);
    background: var(--mint);
    font-size: 20px;
}

.salary-form label {
    display: block;
    margin: 14px 0 7px;
    color: #506158;
    font-size: 12px;
    font-weight: 600;
}

.salary-form input,
.salary-form select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d4e0d6;
    border-radius: 4px;
    outline: 0;
    color: var(--ink);
    background: #fbfdfb;
    font: inherit;
}

.salary-form input:focus,
.salary-form select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px #dff2e7;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.primary-button {
    width: 100%;
    padding: 13px 16px;
    margin-top: 22px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: var(--green);
    cursor: pointer;
    font: 600 13px 'DM Sans', sans-serif;
}

.primary-button span {
    float: right;
    font-size: 17px;
    line-height: 12px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th:nth-child(1), td:nth-child(1) { width: 34%; }
th:nth-child(2), td:nth-child(2) { width: 23%; }
th:nth-child(3), td:nth-child(3) { width: 23%; }
th:nth-child(4), td:nth-child(4) { width: 20%; }

th {
    padding: 0 14px 13px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .8px;
    text-align: left;
    text-transform: uppercase;
}

td {
    padding: 16px 14px;
    border-bottom: 1px solid #edf2ed;
    color: #516057;
    font-size: 13px;
    white-space: nowrap;
}

td strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.amount {
    color: var(--green);
    font-weight: 700;
}

.actions {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid #cfe2d4;
    border-radius: 4px;
    color: var(--green);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.action-link + .action-link {
    margin-left: 8px;
}

.action-link:hover {
    border-color: var(--green);
    background: var(--mint);
}

.empty-state {
    padding: 45px 14px;
    color: var(--muted);
    text-align: center;
}

.site-footer {
    max-width: 1240px;
    padding: 0 28px 28px;
    margin: auto;
    color: #8a978e;
    font-size: 11px;
}

.payslip-container {
    border: 1px solid #ddd;
    padding: 30px;
    max-width: 800px;
    margin: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.summary-box {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.net-pay-card {
    background: #E8F5E9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 200px;
}

.net-pay-card h1 {
    color: #2E7D32;
    margin: 0;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.details-table th {
    background: #f9f9f9;
    text-align: left;
    padding: 10px;
    border-bottom: 1px dashed #ccc;
}

.details-table td {
    padding: 10px;
}

.total-footer {
    background: #F5FCFF;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-weight: bold;
}

@media (max-width: 800px) {
    .dashboard {
        padding-top: 34px;
    }

    .page-heading {
        display: block;
    }

    .date-badge {
        display: inline-block;
        margin-top: 18px;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .history-panel {
        order: 2;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 0 18px;
    }

    .topbar-meta {
        display: none;
    }

    .dashboard {
        padding: 28px 16px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: auto;
        padding: 17px;
    }

    .metric-card strong {
        margin-top: 8px;
        font-size: 25px;
    }

    .panel {
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    th,
    td {
        padding-left: 8px;
        padding-right: 8px;
    }
}

.employee-metric {
    position: relative;
}

.add-employee-button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border: 1px solid #b9dcc5;
    border-radius: 50%;
    color: var(--green);
    background: var(--mint);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.add-employee-button:hover {
    color: #fff;
    background: var(--green);
}