@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800;900&display=swap");

:root {
    --app-ink: #101828;
    --app-muted: #667085;
    --app-soft: #f7f3ea;
    --app-line: rgba(16, 24, 40, .1);
    --app-gold: #f59e0b;
    --app-orange: #ff7a18;
    --app-green: #12805c;
    --app-red: #b42318;
    --app-surface: rgba(255, 255, 255, .86);
    --app-shadow: 0 18px 48px rgba(16, 24, 40, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    color: var(--app-ink);
    background:
        radial-gradient(circle at 10% -10%, rgba(245, 158, 11, .22), transparent 34%),
        radial-gradient(circle at 110% 15%, rgba(18, 128, 92, .12), transparent 30%),
        #f7f3ea !important;
}

a {
    color: inherit;
}

.app-nav-shell {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(247, 243, 234, .82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--app-line);
}

.app-nav-inner {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    min-height: 78px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
}

.app-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-decoration: none;
    color: var(--app-ink);
    font-weight: 950;
    letter-spacing: -.04em;
    font-size: 22px;
}

.app-brand span {
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: 4px;
}

.app-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px;
    border: 1px solid rgba(16, 24, 40, .08);
    background: rgba(255, 255, 255, .52);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.app-nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: transparent;
    color: var(--app-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.app-nav-links a:hover {
    color: var(--app-ink);
    background: rgba(16, 24, 40, .05);
}

.app-nav-links a.active {
    background: var(--app-ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(16, 24, 40, .18);
}

.app-user-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.app-balance {
    border-radius: 16px;
    background: #ecfdf3;
    color: var(--app-green);
    padding: 10px 13px;
    font-weight: 950;
    white-space: nowrap;
    border: 1px solid rgba(18, 128, 92, .14);
    box-shadow: 0 10px 28px rgba(18, 128, 92, .08);
}

.app-user {
    border-radius: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    padding: 10px 13px;
    font-weight: 950;
    white-space: nowrap;
    color: var(--app-ink);
}

.app-logout-form {
    margin: 0;
}

.app-logout {
    border: 1px solid rgba(159, 18, 57, .12);
    border-radius: 16px;
    padding: 11px 13px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 950;
    cursor: pointer;
}

.app-page,
.page.app-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 28px;
    padding-bottom: 92px;
}

.app-bottom-nav {
    display: none;
}

.app-page h1 {
    margin: 0 0 10px;
    font-size: clamp(30px, 5vw, 46px);
    letter-spacing: -.045em;
}

.app-page h2 {
    letter-spacing: -.025em;
}

.app-card,
.card,
.table-card {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: 24px;
    box-shadow: var(--app-shadow);
}

.button,
button.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    background: var(--app-orange);
    color: #1f1308;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.button.dark,
a.button.dark {
    background: var(--app-ink);
    color: #fff;
}

.alert,
.success,
.error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
}

.success {
    background: #e4f7e7;
    color: #165b2d;
}

.error {
    background: #fde8e8;
    color: #8a1c1c;
}

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff2d9;
    color: #8a4b00;
    font-size: 13px;
    font-weight: 900;
}

.status.approved,
.status.won,
.status.active,
.market-open,
.text-win {
    background: #e4f7e7;
    color: #165b2d;
}

.status.rejected,
.status.lost,
.status.cancelled,
.market-closed,
.text-loss {
    background: #fde8e8;
    color: #8a1c1c;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.app-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(16, 24, 40, .08);
    text-align: left;
    vertical-align: middle;
}

.app-table th {
    color: var(--app-muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(246, 239, 225, .62);
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

input,
select,
textarea {
    font-family: inherit;
}

@media (max-width: 980px) {
    .app-nav-inner {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px 0;
    }

    .app-brand {
        font-size: 20px;
    }

    .app-user-panel {
        justify-content: space-between;
        width: 100%;
    }

    .app-nav-links {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
        flex-wrap: nowrap;
        border-radius: 18px;
    }

    .app-nav-links a {
        flex: 0 0 auto;
    }
}

@media (max-width: 680px) {
    .app-nav-shell {
        position: relative;
    }

    .app-nav-inner {
        min-height: 0;
    }

    .app-nav-links {
        display: none;
    }

    .app-user-panel {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .app-balance,
    .app-user {
        font-size: 14px;
    }

    .app-user {
        text-align: center;
    }

    .app-logout-form {
        display: none;
    }

    .app-page,
    .page.app-page {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
    }

    .app-bottom-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        padding: 8px;
        background: rgba(16, 24, 40, .92);
        backdrop-filter: blur(18px);
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 24px;
        box-shadow: 0 18px 50px rgba(16, 24, 40, .28);
    }

    .app-bottom-nav a {
        min-width: 0;
        color: rgba(255, 255, 255, .72);
        text-decoration: none;
        text-align: center;
        font-size: 11px;
        font-weight: 900;
        padding: 10px 4px;
        border-radius: 16px;
    }

    .app-bottom-nav a.active {
        background: #fff;
        color: var(--app-ink);
    }
}
