:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f3f6f8;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --text: #17202a;
    --muted: #64748b;
    --border: #d9e2ea;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --info: #2563eb;
    --warning: #ad6b00;
    --danger: #b42318;
    --shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
    line-height: 1.18;
    letter-spacing: 0;
}

h1 {
    font-size: 28px;
    font-weight: 750;
}

h2 {
    margin-top: 28px;
    font-size: 19px;
    font-weight: 720;
}

h3 {
    margin-top: 18px;
    font-size: 15px;
    font-weight: 700;
}

p {
    margin: 0 0 12px;
}

.app-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: var(--sidebar);
    color: #f7fbf8;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    flex: 0 0 38px;
    border-radius: var(--radius);
    background: #dbeafe;
    color: var(--accent-strong);
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: #a8b7ae;
    font-size: 12px;
    line-height: 1.2;
}

.side-nav {
    display: grid;
    gap: 4px;
    overflow: auto;
    padding: 2px 0;
}

.nav-link {
    display: block;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: #d9e3dd;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-soft);
    color: #ffffff;
    text-decoration: none;
}

.nav-link.active {
    box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar-form {
    margin-top: auto;
}

.sidebar-form button {
    width: 100%;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.app-main {
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 82px;
    padding: 18px 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(246, 247, 249, 0.92);
    backdrop-filter: blur(12px);
}

.topbar-kicker {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar-link {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.content-panel {
    width: min(1180px, calc(100vw - 308px));
    margin: 28px auto 56px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.content-panel > p:first-child,
.content-panel section:first-child > p:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.content-panel > p:first-child a,
.content-panel section:first-child > p:first-child a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--text);
}

.content-panel section:first-child > p:first-child a:first-child,
.auth-panel form + p a,
.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.content-panel section:first-child > p:first-child a:first-child:hover,
.button-primary:hover {
    background: var(--accent-strong);
    text-decoration: none;
}

.content-panel > div:has(strong),
.auth-panel > div:has(strong) {
    margin: 0 0 16px;
    padding: 11px 12px;
    border: 1px solid #bfe3d0;
    border-radius: var(--radius);
    background: #edf9f2;
    color: #14532d;
}

section {
    margin-bottom: 28px;
}

fieldset {
    min-width: 0;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

legend {
    padding: 0 6px;
    color: var(--text);
    font-weight: 750;
}

.metric-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.metric-card,
.content-panel article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
}

.metric-card strong,
.content-panel article strong {
    display: block;
    margin-bottom: 4px;
    font-size: 22px;
    line-height: 1.1;
}

.metric-card p,
.content-panel article p {
    margin: 0;
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.status-draft,
.status-void {
    background: #e5e7eb;
    color: #374151;
}

.status-scheduled,
.status-sent,
.status-exported,
.status-reimbursable {
    background: #dbeafe;
    color: #1e40af;
}

.status-in_progress,
.status-submitted,
.status-pending,
.status-pending_reimbursement {
    background: #fef3c7;
    color: #92400e;
}

.status-completed,
.status-approved,
.status-paid,
.status-reimbursed,
.status-receipt-attached {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled,
.status-rejected,
.status-overdue,
.status-missing-receipt {
    background: #fee2e2;
    color: #991b1b;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

thead {
    background: #eef3f0;
}

th,
td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: #34423b;
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fbfcfb;
}

form {
    margin: 0 0 18px;
}

form div {
    margin-bottom: 12px;
}

label {
    display: block;
    margin: 0 0 5px;
    color: #33433b;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: min(100%, 520px);
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cfd8d3;
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
    margin-right: 7px;
}

button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

button:hover {
    background: var(--accent-strong);
}

td form {
    display: inline-flex;
    margin: 4px 0 0 6px;
}

td button {
    min-height: 31px;
    padding: 5px 8px;
    font-size: 12px;
}

.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef3f0 0%, #f8faf9 56%, #eef4ff 100%);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.auth-panel {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-brand {
    margin-bottom: 24px;
    color: var(--text);
}

.auth-panel h1 {
    margin-bottom: 18px;
}

.auth-panel input {
    width: 100%;
}

.platform-shell .app-sidebar {
    background: #111827;
}

.platform-shell .nav-link:hover,
.platform-shell .nav-link.active {
    background: #1f2937;
}

.landing-body {
    background: #f4f8f5;
}

.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 12%, rgba(31, 138, 91, 0.12), transparent 28%),
        linear-gradient(180deg, #f4f8f5 0%, #ffffff 44%, #f6f8fa 100%);
    color: #132018;
}

.landing-container {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.landing-header {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(19, 32, 24, 0.08);
    background: rgba(244, 248, 245, 0.88);
    backdrop-filter: blur(14px);
}

.landing-nav {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.landing-brand,
.landing-links {
    display: flex;
    align-items: center;
}

.landing-brand {
    gap: 10px;
    color: #132018;
    text-decoration: none;
}

.landing-brand:hover {
    text-decoration: none;
}

.landing-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
}

.landing-links a {
    color: #33433b;
    font-size: 14px;
    font-weight: 700;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 800;
    text-decoration: none;
}

.btn-primary {
    border: 1px solid #178456;
    background: #178456;
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(23, 132, 86, 0.18);
}

.btn-primary:hover {
    background: #126b46;
    text-decoration: none;
}

.btn-secondary {
    border: 1px solid #cfd8d3;
    background: #ffffff;
    color: #17202a;
}

.btn-secondary:hover {
    border-color: #aebbb4;
    text-decoration: none;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.92fr);
    gap: 54px;
    align-items: center;
    padding: 82px 0 74px;
}

.hero-content h1 {
    max-width: 660px;
    margin: 0 0 20px;
    font-size: clamp(42px, 6vw, 70px);
    line-height: 0.98;
    font-weight: 850;
    color: #101c16;
}

.hero-subtitle {
    max-width: 610px;
    margin-bottom: 26px;
    color: #4b5b53;
    font-size: 19px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.hero-benefits {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    color: #2e4338;
    font-weight: 700;
    list-style: none;
}

.hero-benefits li {
    position: relative;
    padding-left: 24px;
}

.hero-benefits li::before {
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dff6e9;
    color: #178456;
    content: "✓";
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

.hero-preview {
    min-width: 0;
}

.preview-card {
    padding: 22px;
    border: 1px solid #d5e1db;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(19, 32, 24, 0.14);
}

.preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e3ebe6;
}

.preview-header p {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.preview-header h2 {
    margin: 0;
    font-size: 20px;
}

.preview-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.preview-metrics div {
    padding: 14px;
    border: 1px solid #e3ebe6;
    border-radius: 12px;
    background: #f8fbf9;
}

.preview-metrics span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
}

.preview-metrics strong {
    font-size: 24px;
    line-height: 1;
}

.preview-expenses h3 {
    margin: 0 0 10px;
}

.expense-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(70px, 0.7fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #edf2ef;
    font-size: 13px;
}

.landing-section {
    padding: 64px 0;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.section-heading h2,
.final-cta h2 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.section-heading p,
.final-cta p {
    color: #5f6f67;
    font-size: 17px;
}

.feature-grid,
.pricing-grid,
.steps-grid {
    display: grid;
    gap: 16px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.problem-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.step-card,
.pricing-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid #dce6e0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.feature-card h3,
.step-card h3,
.pricing-card h3 {
    margin-top: 0;
    font-size: 18px;
}

.feature-card p,
.step-card p,
.pricing-card p {
    color: #5f6f67;
}

.steps-grid,
.pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 820px;
}

.step-card span {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #178456;
    color: #ffffff;
    font-weight: 850;
}

.pricing-card strong {
    display: block;
    margin: 12px 0;
    font-size: 38px;
    line-height: 1;
}

.pricing-card-featured {
    border-color: #9fd7b9;
    box-shadow: 0 20px 44px rgba(23, 132, 86, 0.14);
}

.final-cta {
    margin-top: 42px;
    padding: 72px 0;
    background: #102119;
    color: #ffffff;
    text-align: center;
}

.final-cta .landing-container {
    max-width: 780px;
}

.final-cta p {
    color: #c9d8d0;
}

.landing-footer {
    padding: 34px 0;
    background: #ffffff;
    border-top: 1px solid #dce6e0;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.footer-grid nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: static;
        height: auto;
        padding: 14px;
    }

    .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
    }

    .sidebar-form {
        margin-top: 6px;
    }

    .app-topbar {
        position: static;
        min-height: 0;
        padding: 18px 16px;
        align-items: flex-start;
    }

    .content-panel {
        width: auto;
        margin: 16px;
        padding: 16px;
        overflow-x: auto;
    }

    h1 {
        font-size: 24px;
    }

    table {
        min-width: 720px;
    }

    input,
    select,
    textarea {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .landing-container {
        width: min(100% - 28px, 1160px);
    }

    .landing-nav {
        min-height: 0;
        padding: 14px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-links {
        width: 100%;
        justify-content: flex-start;
    }

    .landing-links .btn-primary {
        width: 100%;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 34px;
        padding: 48px 0 44px;
    }

    .hero-content h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .hero-actions,
    .hero-actions a {
        width: 100%;
    }

    .preview-card {
        padding: 16px;
        border-radius: 14px;
    }

    .preview-header,
    .expense-row {
        display: grid;
    }

    .preview-metrics,
    .feature-grid,
    .problem-grid,
    .steps-grid,
    .pricing-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .expense-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .landing-section {
        padding: 42px 0;
    }

    .feature-card,
    .step-card,
    .pricing-card {
        padding: 18px;
    }

    .pricing-card .btn-primary,
    .pricing-card .btn-secondary,
    .final-cta .btn-primary {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .side-nav {
        grid-template-columns: 1fr;
    }

    .app-topbar {
        display: block;
    }

    .topbar-link {
        display: inline-flex;
        margin-top: 10px;
    }

    .auth-shell {
        padding: 16px;
    }

    .auth-panel {
        padding: 20px;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .app-sidebar,
    .app-topbar,
    .content-panel > p:first-child {
        display: none;
    }

    .app-shell {
        display: block;
    }

    .content-panel {
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
}
