:root {
    --ltp-ink: #17212b;
    --ltp-muted: #65717d;
    --ltp-line: #dfe5e8;
    --ltp-soft: #f4f7f6;
    --ltp-paper: #ffffff;
    --ltp-teal: #087f73;
    --ltp-teal-dark: #075f58;
    --ltp-teal-soft: #e4f4f1;
    --ltp-coral: #e46f51;
    --ltp-gold: #c99a35;
    --ltp-navy: #123349;
    --ltp-danger: #b43c45;
    --ltp-warning: #9a6500;
    --ltp-shadow: 0 18px 55px rgba(23, 33, 43, .10);
    --ltp-radius: 18px;
    --ltp-font: Aptos, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --ltp-display: Aptos Display, Aptos, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--ltp-soft);
    color: var(--ltp-ink);
    font-family: var(--ltp-font);
    font-size: 15px;
}

body.ltp-portal-page { min-height: 100vh; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ltp-auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr);
    min-height: 100vh;
}

.ltp-auth-story {
    position: relative;
    display: flex;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 15% 18%, rgba(70, 207, 182, .35), transparent 30%),
        radial-gradient(circle at 82% 72%, rgba(228, 111, 81, .24), transparent 28%),
        linear-gradient(145deg, #0a615e 0%, #123349 58%, #101f2c 100%);
}

.ltp-auth-story::after {
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 48% 52% 62% 38%;
    content: "";
    transform: rotate(23deg);
}

.ltp-auth-story-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(640px, 78%);
    margin: auto;
}

.ltp-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ltp-navy);
    font-family: var(--ltp-display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.ltp-wordmark span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px 13px 13px 4px;
    color: #fff;
    background: var(--ltp-teal);
    font-size: 14px;
}

.ltp-wordmark-light { color: #fff; }
.ltp-wordmark-light span { color: var(--ltp-navy); background: #fff; }
.ltp-mobile-wordmark { display: none; margin-bottom: 48px; }

.ltp-eyebrow {
    margin: 0 0 14px;
    color: var(--ltp-teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.ltp-auth-story .ltp-eyebrow { margin-top: 90px; color: #8de5d3; }

.ltp-auth-story h1 {
    max-width: 620px;
    margin: 0;
    font-family: var(--ltp-display);
    font-size: clamp(44px, 5vw, 76px);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.ltp-auth-story > div > p:not(.ltp-eyebrow) {
    max-width: 590px;
    margin: 28px 0 0;
    color: rgba(255,255,255,.76);
    font-size: 18px;
    line-height: 1.7;
}

.ltp-auth-proof {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 70px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.ltp-auth-proof div { display: grid; gap: 5px; }
.ltp-auth-proof strong { font-family: var(--ltp-display); font-size: 14px; }
.ltp-auth-proof span { color: rgba(255,255,255,.58); font-size: 12px; }

.ltp-auth-panel {
    display: grid;
    padding: 50px;
    place-items: center;
    background: #f8faf9;
}

.ltp-auth-card { width: min(430px, 100%); }
.ltp-auth-card h1,
.ltp-auth-card h2 {
    margin: 0;
    color: var(--ltp-ink);
    font-family: var(--ltp-display);
    font-size: 36px;
    letter-spacing: -.045em;
}
.ltp-auth-copy { margin: 10px 0 32px; color: var(--ltp-muted); }

.ltp-auth-card form p { margin: 0 0 18px; }
.ltp-auth-card form label {
    display: block;
    margin-bottom: 7px;
    color: var(--ltp-ink);
    font-size: 13px;
    font-weight: 600;
}

.ltp-auth-card input[type="text"],
.ltp-auth-card input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--ltp-line);
    border-radius: 11px;
    outline: none;
    background: #fff;
    box-shadow: 0 1px 2px rgba(23,33,43,.02);
}

.ltp-auth-card input:focus { border-color: var(--ltp-teal); box-shadow: 0 0 0 4px rgba(8,127,115,.10); }
.ltp-login-remember { display: flex; align-items: center; justify-content: space-between; }
.ltp-auth-card .forgetmenot label { display: inline; margin: 0 0 0 6px; color: var(--ltp-muted); font-weight: 400; }
.ltp-auth-card .submit { margin-top: 24px; }
.ltp-auth-card .button-primary {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--ltp-teal);
    cursor: pointer;
    font-weight: 700;
}
.ltp-auth-card .button-primary:hover { background: var(--ltp-teal-dark); }
.ltp-forgot { display: inline-block; margin-top: 2px; color: var(--ltp-teal); font-size: 13px; font-weight: 600; text-decoration: none; }
.ltp-security-note { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--ltp-line); color: var(--ltp-muted); font-size: 12px; line-height: 1.6; }

.ltp-alert {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.ltp-alert-error { color: #842029; background: #f8d7da; }
.ltp-alert-warning { color: #745000; background: #fff1cb; }
.ltp-alert-info { color: #075d55; background: var(--ltp-teal-soft); }

.ltp-app { min-height: 100vh; }
.ltp-loading-screen { display: grid; min-height: 100vh; place-content: center; place-items: center; color: var(--ltp-muted); }
.ltp-loading-mark { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 18px 18px 18px 5px; color: #fff; background: var(--ltp-teal); font-family: var(--ltp-display); font-weight: 800; animation: ltp-pulse 1.4s ease-in-out infinite; }
@keyframes ltp-pulse { 50% { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(8,127,115,.24); } }

.ltp-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.ltp-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 26px 18px 20px;
    color: #d9e4e7;
    background: var(--ltp-navy);
}
.ltp-sidebar .ltp-wordmark { padding: 0 9px 26px; color: #fff; }
.ltp-sidebar .ltp-wordmark span { background: #3ab7a4; }
.ltp-nav { display: grid; gap: 4px; }
.ltp-nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-radius: 10px;
    color: #bdcbd0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.ltp-nav button:hover { color: #fff; background: rgba(255,255,255,.06); }
.ltp-nav button.is-active { color: #fff; background: rgba(58,183,164,.18); font-weight: 600; }
.ltp-nav-icon { width: 22px; font-size: 16px; text-align: center; }
.ltp-sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.ltp-user-chip { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.ltp-user-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--ltp-navy); background: #a7e1d6; font-weight: 800; }
.ltp-user-chip strong, .ltp-user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltp-user-chip strong { display: block; color: #fff; font-size: 12px; }
.ltp-user-chip span { display: block; margin-top: 3px; color: #859aa2; font-size: 10px; }

.ltp-workspace { min-width: 0; }
.ltp-topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 76px;
    padding: 0 34px;
    border-bottom: 1px solid var(--ltp-line);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
}
.ltp-company-context { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ltp-company-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ltp-coral); box-shadow: 0 0 0 4px rgba(228,111,81,.12); }
.ltp-company-select { min-width: 250px; border: 0; outline: 0; color: var(--ltp-ink); background: transparent; font-family: var(--ltp-display); font-weight: 700; }
.ltp-topbar-spacer { flex: 1; }
.ltp-tax-chip { padding: 7px 10px; border: 1px solid var(--ltp-line); border-radius: 999px; color: var(--ltp-muted); background: #fff; font-size: 11px; font-weight: 600; }
.ltp-logout { color: var(--ltp-muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.ltp-logout:hover { color: var(--ltp-danger); }

.ltp-main { width: min(1480px, 100%); margin: 0 auto; padding: 34px; }
.ltp-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.ltp-page-heading h1 { margin: 0; font-family: var(--ltp-display); font-size: 31px; letter-spacing: -.04em; }
.ltp-page-heading p { margin: 7px 0 0; color: var(--ltp-muted); }

.ltp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--ltp-line);
    border-radius: 10px;
    color: var(--ltp-ink);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.ltp-button:hover { border-color: #b8c5ca; }
.ltp-button:disabled { cursor: not-allowed; opacity: .5; }
.ltp-button-primary { border-color: var(--ltp-teal); color: #fff; background: var(--ltp-teal); }
.ltp-button-primary:hover { border-color: var(--ltp-teal-dark); background: var(--ltp-teal-dark); }
.ltp-button-danger { border-color: #f1c2c6; color: var(--ltp-danger); background: #fff8f8; }
.ltp-button-small { min-height: 32px; padding: 0 10px; font-size: 11px; }

.ltp-grid { display: grid; gap: 20px; }
.ltp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ltp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ltp-card {
    border: 1px solid var(--ltp-line);
    border-radius: var(--ltp-radius);
    background: var(--ltp-paper);
    box-shadow: 0 5px 24px rgba(23,33,43,.035);
}
.ltp-card-body { padding: 22px; }
.ltp-card h2, .ltp-card h3 { margin: 0; font-family: var(--ltp-display); letter-spacing: -.025em; }
.ltp-card h2 { font-size: 18px; }
.ltp-card h3 { font-size: 15px; }

.ltp-stat { padding: 22px; }
.ltp-stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--ltp-muted); font-size: 12px; font-weight: 600; }
.ltp-stat-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: var(--ltp-teal); background: var(--ltp-teal-soft); }
.ltp-stat-value { margin-top: 18px; font-family: var(--ltp-display); font-size: 29px; font-weight: 800; letter-spacing: -.04em; }
.ltp-stat-note { margin-top: 5px; color: var(--ltp-muted); font-size: 11px; }

.ltp-setup-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    color: #fff;
    background: linear-gradient(120deg, var(--ltp-teal-dark), var(--ltp-navy));
}
.ltp-setup-card::after { position: absolute; right: -50px; bottom: -75px; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; content: ""; }
.ltp-setup-card h2 { font-size: 22px; }
.ltp-setup-card p { max-width: 620px; color: rgba(255,255,255,.72); }
.ltp-checklist { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.ltp-check { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 11px; background: rgba(255,255,255,.08); font-size: 12px; }
.ltp-check span { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); }
.ltp-check.is-done span { color: var(--ltp-navy); background: #8de5d3; }

.ltp-table-wrap { overflow-x: auto; }
.ltp-table { width: 100%; border-collapse: collapse; }
.ltp-table th, .ltp-table td { padding: 13px 16px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: middle; }
.ltp-table th { color: var(--ltp-muted); background: #fafbfb; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ltp-table td { font-size: 13px; }
.ltp-table tr:last-child td { border-bottom: 0; }
.ltp-table-main { font-weight: 700; }
.ltp-table-sub { display: block; margin-top: 3px; color: var(--ltp-muted); font-size: 11px; }

.ltp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.ltp-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.ltp-badge-active, .ltp-badge-finalised, .ltp-badge-approved { color: #08735c; background: #e1f5ee; }
.ltp-badge-draft { color: #6d7780; background: #edf0f2; }
.ltp-badge-calculated { color: #1d62a2; background: #e7f1fb; }
.ltp-badge-reviewed { color: #7e5a00; background: #fff2ca; }
.ltp-badge-reversed { color: var(--ltp-danger); background: #fbe8ea; }

.ltp-empty { padding: 50px 24px; color: var(--ltp-muted); text-align: center; }
.ltp-empty-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 15px; place-items: center; border-radius: 16px; color: var(--ltp-teal); background: var(--ltp-teal-soft); font-size: 22px; }
.ltp-empty h3 { color: var(--ltp-ink); }
.ltp-empty p { max-width: 460px; margin: 8px auto 20px; line-height: 1.6; }

.ltp-modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; padding: 24px; overflow-y: auto; place-items: center; background: rgba(12,30,42,.58); backdrop-filter: blur(4px); }
.ltp-modal { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: var(--ltp-shadow); }
.ltp-modal-wide { width: min(980px, 100%); }
.ltp-modal-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--ltp-line); background: #fff; }
.ltp-modal-head h2 { margin: 0; font-family: var(--ltp-display); font-size: 20px; }
.ltp-modal-close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: var(--ltp-soft); cursor: pointer; }
.ltp-modal-body { padding: 24px; }
.ltp-modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--ltp-line); background: #fff; }

.ltp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.ltp-form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ltp-field { display: grid; gap: 7px; align-content: start; }
.ltp-field-full { grid-column: 1 / -1; }
.ltp-field label { color: #3f4c56; font-size: 11px; font-weight: 700; }
.ltp-field input, .ltp-field select, .ltp-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--ltp-line);
    border-radius: 9px;
    outline: 0;
    color: var(--ltp-ink);
    background: #fff;
}
.ltp-field textarea { min-height: 86px; resize: vertical; }
.ltp-field input:focus, .ltp-field select:focus, .ltp-field textarea:focus { border-color: var(--ltp-teal); box-shadow: 0 0 0 3px rgba(8,127,115,.09); }
.ltp-field-help { color: var(--ltp-muted); font-size: 10px; line-height: 1.5; }
.ltp-section-title { grid-column: 1 / -1; margin: 8px 0 -3px; padding-bottom: 8px; border-bottom: 1px solid var(--ltp-line); color: var(--ltp-navy); font-family: var(--ltp-display); font-size: 13px; font-weight: 800; }
.ltp-checkbox { display: flex; gap: 8px; align-items: center; min-height: 42px; }

.ltp-company-card { position: relative; padding: 22px; }
.ltp-company-card::before { position: absolute; top: 0; right: 22px; left: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ltp-teal); content: ""; }
.ltp-company-monogram { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--ltp-navy); background: var(--ltp-teal-soft); font-family: var(--ltp-display); font-weight: 800; }
.ltp-company-card h3 { margin-top: 16px; }
.ltp-company-card p { margin: 6px 0 18px; color: var(--ltp-muted); font-size: 12px; }
.ltp-company-meta { display: grid; gap: 8px; padding-top: 15px; border-top: 1px solid var(--ltp-line); color: var(--ltp-muted); font-size: 11px; }

.ltp-payroll-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.ltp-payroll-editor { overflow: hidden; }
.ltp-payroll-toolbar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 18px; border-bottom: 1px solid var(--ltp-line); background: #fafbfb; }
.ltp-payroll-section { border-bottom: 1px solid var(--ltp-line); }
.ltp-payroll-section:last-child { border-bottom: 0; }
.ltp-payroll-section summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 19px; cursor: pointer; font-family: var(--ltp-display); font-weight: 800; list-style: none; }
.ltp-payroll-section summary::-webkit-details-marker { display: none; }
.ltp-payroll-section summary span { color: var(--ltp-muted); font-family: var(--ltp-font); font-size: 11px; font-weight: 500; }
.ltp-payroll-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; padding: 0 19px 19px; }
.ltp-summary-card { position: sticky; top: 96px; overflow: hidden; }
.ltp-summary-head { padding: 19px; color: #fff; background: var(--ltp-navy); }
.ltp-summary-head p { margin: 4px 0 0; color: rgba(255,255,255,.6); font-size: 11px; }
.ltp-summary-lines { padding: 8px 19px; }
.ltp-summary-line { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--ltp-line); color: var(--ltp-muted); font-size: 12px; }
.ltp-summary-line strong { color: var(--ltp-ink); }
.ltp-summary-line-total { margin: 5px -19px 0; padding: 17px 19px; border: 0; color: #fff; background: var(--ltp-teal); font-size: 13px; }
.ltp-summary-line-total strong { color: #fff; font-family: var(--ltp-display); font-size: 20px; }
.ltp-summary-actions { display: grid; gap: 8px; padding: 15px 19px 19px; }
.ltp-result-drawer { margin-top: 18px; }
.ltp-result-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 15px; padding: 11px 0; border-bottom: 1px solid var(--ltp-line); font-size: 12px; }
.ltp-result-item small { grid-column: 1 / -1; color: var(--ltp-muted); line-height: 1.5; }
.ltp-warning-list { margin: 14px 0 0; padding-left: 18px; color: var(--ltp-warning); font-size: 11px; line-height: 1.6; }

.ltp-toast-stack { position: fixed; z-index: 200; top: 20px; right: 20px; display: grid; gap: 10px; width: min(390px, calc(100vw - 40px)); }
.ltp-toast { padding: 14px 16px; border: 1px solid var(--ltp-line); border-left: 4px solid var(--ltp-teal); border-radius: 11px; background: #fff; box-shadow: var(--ltp-shadow); font-size: 12px; line-height: 1.5; animation: ltp-slide .22s ease-out; }
.ltp-toast-error { border-left-color: var(--ltp-danger); }
@keyframes ltp-slide { from { opacity: 0; transform: translateY(-8px); } }

.ltp-mobile-menu { display: none; }

@media (max-width: 1100px) {
    .ltp-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .ltp-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .ltp-payroll-layout { grid-template-columns: 1fr; }
    .ltp-summary-card { position: static; }
    .ltp-payroll-fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
    .ltp-auth-shell { grid-template-columns: 1fr; }
    .ltp-auth-story { display: none; }
    .ltp-mobile-wordmark { display: inline-flex; }
    .ltp-shell { grid-template-columns: 1fr; }
    .ltp-sidebar { position: fixed; z-index: 50; left: -260px; width: 244px; transition: left .2s ease; }
    .ltp-shell.is-menu-open .ltp-sidebar { left: 0; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .ltp-mobile-menu { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--ltp-line); border-radius: 9px; background: #fff; }
    .ltp-topbar { padding: 0 18px; }
    .ltp-company-select { min-width: 0; max-width: 180px; }
    .ltp-main { padding: 24px 18px; }
    .ltp-checklist { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .ltp-auth-panel { padding: 28px 20px; }
    .ltp-grid-4, .ltp-grid-3, .ltp-form-grid, .ltp-form-grid-3 { grid-template-columns: 1fr; }
    .ltp-page-heading { align-items: stretch; flex-direction: column; }
    .ltp-payroll-toolbar { grid-template-columns: 1fr; }
    .ltp-payroll-fields { grid-template-columns: 1fr; }
    .ltp-tax-chip { display: none; }
    .ltp-modal-backdrop { padding: 0; place-items: stretch; }
    .ltp-modal { min-height: 100vh; max-height: none; border-radius: 0; }
}
