.tr-page {
    max-width: 1450px;
    margin: 0 auto;
}
.tr-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}
.tr-heading h1 {
    font-size: 26px;
    margin: 8px 0;
}
.tr-heading p {
    color: #64748b;
    max-width: 760px;
    line-height: 1.6;
}
.tr-actions,
.tr-tabs,
.tr-controls,
.tr-table-tools,
.tr-row-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.tr-tabs {
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.tr-tabs a {
    font-size: 13px;
    margin-left: 8px;
}
.tr-controls {
    margin: 20px 0;
    align-items: end;
}
.tr-field {
    display: grid;
    gap: 7px;
    font-size: 13px;
    min-width: 160px;
}
.tr-field > span {
    font-weight: 600;
}
.tr-field input,
.tr-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccd5e1;
    border-radius: 6px;
    background: white;
    color: #152439;
    min-height: 40px;
}
.tr-field small,
.tr-hint {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}
.tr-period {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    gap: 12px;
}
.tr-period > div {
    text-align: center;
}
.tr-period strong {
    font-size: 18px;
}
.tr-period small {
    display: block;
    color: #64748b;
    margin-top: 5px;
}
.tr-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}
.tr-kpis > div {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 20px;
}
.tr-kpis small {
    display: block;
    color: #64748b;
    font-size: 12px;
}
.tr-kpis strong {
    display: block;
    font-size: 25px;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}
.tr-table-tools {
    margin: 24px 0 12px;
    align-items: end;
}
.tr-empty {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 48px 24px;
    text-align: center;
    margin: 20px 0;
}
.tr-empty h2 {
    font-size: 20px;
}
.tr-empty p {
    color: #64748b;
    line-height: 1.7;
}
.tr-table-wrap {
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: white;
}
.tr-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tr-table-wrap th {
    text-align: left;
    padding: 13px;
    background: #f1f5f9;
    font-size: 12px;
}
.tr-table-wrap td {
    padding: 14px;
    border-top: 1px solid #e2e8f0;
    vertical-align: top;
}
.tr-table-wrap small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
}
.tr-table-wrap .tr-flag {
    color: #92400e;
}
.tr-number {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.tr-row-actions {
    gap: 6px;
    min-width: 120px;
}
.tr-row-actions button {
    font-size: 12px;
    padding: 7px 10px;
}
.tr-status {
    display: inline-block;
    border-radius: 5px;
    background: #eef2ff;
    padding: 4px 7px;
    font-size: 12px;
}
.tr-status.approved {
    color: #166534;
    background: #dcfce7;
}
.tr-status.rejected {
    color: #991b1b;
    background: #fee2e2;
}
.tr-status.changed {
    color: #92400e;
    background: #fef3c7;
}
.tr-notes {
    margin: 24px 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.7;
}
.tr-notes summary {
    cursor: pointer;
    font-weight: 600;
}
.tr-payroll-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    align-items: start;
}
.tr-card {
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.tr-card h2 {
    font-size: 18px;
    margin: 0 0 20px;
}
.tr-card p,
.tr-card li {
    font-size: 13px;
    line-height: 1.7;
    color: #475569;
}
.tr-card button {
    margin-top: 16px;
}
.tr-mappings {
    display: grid;
    gap: 15px;
    margin: 22px 0;
    max-height: 440px;
    overflow: auto;
    padding-right: 6px;
}
.tr-dialog {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 28px;
    max-width: 700px;
    width: 85vw;
    max-height: 80vh;
}
.tr-dialog::backdrop {
    background: #0f172a66;
}
.tr-audit article {
    padding: 14px 0;
    border-top: 1px solid #e2e8f0;
}
.tr-audit small {
    display: block;
    color: #64748b;
    margin-top: 5px;
}
.tr-audit p {
    font-size: 13px;
}
@media (max-width: 700px) {
    .tr-heading {
        display: block;
    }
    .tr-actions {
        margin-top: 16px;
    }
    .tr-kpis {
        grid-template-columns: 1fr 1fr;
    }
    .tr-kpis > div {
        padding: 15px;
    }
    .tr-payroll-grid {
        grid-template-columns: 1fr;
    }
    .tr-controls > .tr-field {
        flex: 1;
        min-width: 145px;
    }
    .tr-period {
        padding: 14px 10px;
    }
    .tr-period strong {
        font-size: 15px;
    }
    .tr-period button {
        font-size: 12px;
        padding: 8px;
    }
    .tr-table-wrap table {
        min-width: 850px;
    }
    .tr-table-tools > .tr-field {
        width: 100%;
    }
    .tr-tabs {
        gap: 8px;
    }
}
.shell:has(.tr-page) .main {
    min-width: 0;
}
.tr-page {
    min-width: 0;
}
@media (max-width: 800px) {
    .shell:has(.tr-page) {
        grid-template-columns: minmax(0, 1fr);
    }
    .shell:has(.tr-page) > .sidebar {
        position: static;
        max-height: none;
        padding: 12px 16px;
        gap: 12px;
        border-bottom: 1px solid var(--border);
        min-width: 0;
    }
    .shell:has(.tr-page) .sidebar .identity {
        display: none;
    }
    .shell:has(.tr-page) .sidebar .nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
    }
    .shell:has(.tr-page) .sidebar .nav-heading {
        display: none;
    }
    .shell:has(.tr-page) .sidebar .nav-item {
        white-space: nowrap;
        flex-shrink: 0;
        width: auto;
    }
    .shell:has(.tr-page) .main {
        padding: 20px 16px;
    }
}
