* {
    box-sizing: border-box;
}

:root {
    --bg: #08090b;
    --panel: #121316;
    --panel-2: #18191d;
    --panel-3: #202126;
    --text: #f5f7ff;
    --muted: #8f97ad;
    --primary: #e32636;
    --primary-2: #ff4d5d;
    --border: rgba(255,255,255,.08);
    --success: #34d399;
    --danger: #fb7185;
    --gold: #f7c65c;
    --shadow: 0 24px 80px rgba(0,0,0,.28);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, rgba(227,38,54,.18), transparent 35%),
        radial-gradient(circle at 90% 85%, rgba(173,24,38,.14), transparent 30%),
        var(--bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

.auth-brand-panel {
    position: relative;
    overflow: hidden;
    padding: 44px 56px;
    border-right: 1px solid var(--border);
    background:
        linear-gradient(145deg, rgba(227,38,54,.08), rgba(14,18,32,.15)),
        #0c0d10;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: -.05em;
    background: linear-gradient(135deg, var(--primary), #b91524);
    box-shadow: 0 14px 35px rgba(227,38,54,.28);
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
}

.brand-name {
    margin-top: 12px;
    font-weight: 800;
    font-size: 22px;
}

.brand-tagline {
    color: var(--muted);
    margin: 6px 0 0;
}

.hero-card {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin-top: 19vh;
}

.hero-card h1 {
    margin: 14px 0 12px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: .98;
    letter-spacing: -.05em;
}

.hero-card p {
    max-width: 560px;
    color: #aab1c5;
    font-size: 17px;
    line-height: 1.7;
}

.hero-badge,
.eyebrow {
    color: #ff6673;
    font-size: 12px;
    letter-spacing: .17em;
    font-weight: 900;
}

.auth-decoration .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    opacity: .55;
}

.orb-one {
    width: 380px;
    height: 380px;
    right: -140px;
    bottom: -120px;
    background: rgba(227,38,54,.16);
}

.orb-two {
    width: 190px;
    height: 190px;
    right: 14%;
    top: 18%;
    background: rgba(195,27,42,.12);
}

.grid-glow {
    position: absolute;
    inset: 0;
    opacity: .08;
    background-image:
        linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}

.auth-form-panel {
    display: grid;
    place-items: center;
    padding: 42px;
    background: rgba(8,9,11,.82);
    backdrop-filter: blur(12px);
}

.auth-form-wrap {
    width: min(100%, 460px);
}

.mobile-brand {
    display: none;
}

.auth-form-wrap h2 {
    margin: 10px 0 8px;
    font-size: 38px;
    letter-spacing: -.04em;
}

.muted {
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.auth-form label > span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #d9def0;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    color: var(--text);
    outline: none;
    background: rgba(255,255,255,.035);
    transition: .2s ease;
}

.auth-form input:focus {
    border-color: rgba(227,38,54,.80);
    box-shadow: 0 0 0 4px rgba(227,38,54,.10);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 86px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 7px;
    bottom: 7px;
    border: 0;
    padding: 0 10px;
    color: #b8c0d8;
    background: transparent;
    cursor: pointer;
}

.form-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.check-row input {
    width: 16px;
    height: 16px;
}

.check-row span {
    margin: 0 !important;
    color: var(--muted) !important;
    font-weight: 500 !important;
}

.text-link,
.auth-switch a {
    color: #ff6673;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease, background .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #b91524);
    color: white;
    box-shadow: 0 12px 26px rgba(227,38,54,.20);
}

.btn-secondary {
    background: rgba(255,255,255,.05);
    border-color: var(--border);
    color: var(--text);
}

.btn-block {
    width: 100%;
    min-height: 52px;
}

.alert {
    margin-top: 18px;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
}

.alert-error {
    background: rgba(251,113,133,.08);
    border: 1px solid rgba(251,113,133,.25);
    color: #fecdd3;
}

.auth-switch {
    text-align: center;
    color: var(--muted);
    margin-top: 24px;
}

/* Dashboard */
.app-body {
    min-height: 100vh;
    background: #0a0b0d;
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 255px 1fr;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 255px;
    overflow-y: auto;
    padding: 22px 14px;
    border-right: 1px solid var(--border);
    background: #090c15;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 18px;
}

.sidebar-brand .brand-name {
    margin: 0;
    font-size: 20px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-section {
    margin: 22px 12px 7px;
    color: #df3342;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    color: #9fa7bc;
    font-size: 14px;
    font-weight: 650;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,.035);
}

.nav-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(227,38,54,.24), rgba(227,38,54,.08));
    border: 1px solid rgba(227,38,54,.16);
}

.main-area {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(10,11,13,.94);
    backdrop-filter: blur(14px);
}

.sidebar-toggle {
    display: none;
    border: 1px solid var(--border);
    color: white;
    background: var(--panel);
    border-radius: 8px;
    height: 38px;
    width: 38px;
}

.topbar-spacer {
    flex: 1;
}

.top-stat {
    display: grid;
    gap: 2px;
    min-width: 96px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.025);
}

.top-stat-label {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
}

.top-stat strong {
    font-size: 14px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 5px;
    padding-left: 13px;
    border-left: 1px solid var(--border);
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #9f1420);
    font-weight: 900;
}

.user-meta {
    display: grid;
    gap: 2px;
}

.user-meta strong {
    font-size: 13px;
}

.user-meta span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 11px;
}

.logout-link {
    color: #b8bfd2;
    font-size: 12px;
    font-weight: 800;
}

.content {
    padding: 32px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 7px 0 5px;
    font-size: 32px;
    letter-spacing: -.04em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent),
        var(--panel);
    box-shadow: 0 12px 40px rgba(0,0,0,.11);
}

.stat-card {
    display: grid;
    gap: 7px;
    padding: 20px;
}

.stat-card strong {
    font-size: 22px;
}

.stat-card small,
.stat-label {
    color: var(--muted);
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr);
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel-large {
    min-height: 370px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.panel h2 {
    margin: 7px 0 0;
    font-size: 22px;
}

.empty-state {
    min-height: 270px;
    display: grid;
    justify-items: center;
    align-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-state h3 {
    margin: 12px 0 4px;
    color: var(--text);
}

.empty-state p {
    max-width: 430px;
    margin: 0 0 18px;
}

.empty-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(227,38,54,.11);
    color: #ff6673;
    font-size: 20px;
}

.wallet-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    color: #bcc4d6;
}

.wallet-row:last-child {
    border-bottom: 0;
}

.wallet-row strong {
    color: white;
}

@media (max-width: 1050px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 36px;
    }

    .mobile-brand .brand-name {
        margin: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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

    .main-area {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-grid;
        place-items: center;
    }

    .top-stat {
        display: none;
    }

    .content {
        padding: 22px 16px;
    }
}

@media (max-width: 560px) {
    .auth-form-panel {
        padding: 26px 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-meta {
        display: none;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Logo PrimeView - tamanho maior */
.sidebar-logo {
    width: 230px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar-brand {
    justify-content: center;
}
