:root {
    --green: #0f8f5f;
    --green2: #13c47f;
    --bg: #f4f7f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(0,0,0,.08);
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 18px;
}

/* THEMES */
.theme-verde {
    --green: #0f8f5f;
    --green2: #13c47f;
    --bg: #f4f7f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(0,0,0,.08);
}

.theme-azul {
    --green: #165dff;
    --green2: #4f8cff;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #64748b;
    --border: rgba(15,23,42,.08);
}

.theme-black {
    --green: #101827;
    --green2: #374151;
    --bg: #080b10;
    --card: #111827;
    --text: #f9fafb;
    --muted: #9ca3af;
    --border: rgba(255,255,255,.08);
}

.theme-gold {
    --green: #9a7b22;
    --green2: #d9b85f;
    --bg: #08140b;
    --card: #102016;
    --text: #f8f3df;
    --muted: #d6cda8;
    --border: rgba(217,184,95,.22);
}

.theme-neon {
    --green: #00a86b;
    --green2: #00ff99;
    --bg: #07110d;
    --card: #0d1b15;
    --text: #effff7;
    --muted: #9ce7c7;
    --border: rgba(0,255,153,.16);
}

.theme-petroleo {
    --green: #0b3d2e;
    --green2: #d4af37;
    --bg: #07100d;
    --card: #101c18;
    --text: #f6f1df;
    --muted: #c9b77c;
    --border: rgba(212,175,55,.18);
}

.theme-rubi {
    --green: #8b0000;
    --green2: #ff3b3b;
    --bg: #140707;
    --card: #210d0d;
    --text: #fff5f5;
    --muted: #e5b4b4;
    --border: rgba(255,59,59,.16);
}

.theme-safira {
    --green: #0f3c88;
    --green2: #42a5ff;
    --bg: #07111f;
    --card: #0e1b2e;
    --text: #eff7ff;
    --muted: #a9c8ea;
    --border: rgba(66,165,255,.16);
}

.theme-esmeralda {
    --green: #047857;
    --green2: #34d399;
    --bg: #06130f;
    --card: #0b1f19;
    --text: #ecfdf5;
    --muted: #9ee7cb;
    --border: rgba(52,211,153,.16);
}

.theme-carbono {
    --green: #111827;
    --green2: #6b7280;
    --bg: #050608;
    --card: #0f1115;
    --text: #f9fafb;
    --muted: #a1a1aa;
    --border: rgba(255,255,255,.10);
}

.theme-royal {
    --green: #312e81;
    --green2: #8b5cf6;
    --bg: #0c0a1f;
    --card: #17122e;
    --text: #f5f3ff;
    --muted: #c4b5fd;
    --border: rgba(139,92,246,.18);
}

.theme-oceano {
    --green: #0369a1;
    --green2: #22d3ee;
    --bg: #06131a;
    --card: #0b202b;
    --text: #ecfeff;
    --muted: #9bdce8;
    --border: rgba(34,211,238,.16);
}

.theme-cobre {
    --green: #92400e;
    --green2: #f59e0b;
    --bg: #120b05;
    --card: #211409;
    --text: #fff7ed;
    --muted: #f3c27a;
    --border: rgba(245,158,11,.18);
}

.theme-prata {
    --green: #475569;
    --green2: #cbd5e1;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --border: rgba(203,213,225,.18);
}

.theme-branco {
    --green: #0f766e;
    --green2: #14b8a6;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(15,23,42,.08);
}

.theme-vinho {
    --green: #7f1d1d;
    --green2: #be123c;
    --bg: #13070a;
    --card: #210d13;
    --text: #fff1f2;
    --muted: #f0a8b7;
    --border: rgba(190,18,60,.18);
}

.theme-ametista {
    --green: #581c87;
    --green2: #d946ef;
    --bg: #12051b;
    --card: #1e0b2e;
    --text: #fdf4ff;
    --muted: #e9a7f5;
    --border: rgba(217,70,239,.16);
}

.theme-floresta {
    --green: #14532d;
    --green2: #84cc16;
    --bg: #071207;
    --card: #0f1f0f;
    --text: #f7fee7;
    --muted: #bddb8c;
    --border: rgba(132,204,22,.16);
}

.theme-laranja {
    --green: #c2410c;
    --green2: #fb923c;
    --bg: #fff7ed;
    --card: #ffffff;
    --text: #1c1917;
    --muted: #78716c;
    --border: rgba(194,65,12,.12);
}

.theme-gelo {
    --green: #0284c7;
    --green2: #bae6fd;
    --bg: #f0f9ff;
    --card: #ffffff;
    --text: #082f49;
    --muted: #64748b;
    --border: rgba(2,132,199,.12);
}

/* RESET */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 82px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

/* HEADER */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 76px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.brand-logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    object-fit: contain;
    display: block;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.brand-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green), var(--green2));
}

.brand strong {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text);
    white-space: nowrap;
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--text);
    font-size: 14px;
}

.desktop-nav a {
    opacity: .86;
}

.desktop-nav a:hover {
    opacity: 1;
    color: var(--green2);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.balance {
    display: none;
}

.balance-box {
    min-width: 92px;
    height: 42px;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.1;
    box-shadow: none;
}

.balance-box .balance-label {
    font-size: 10px;
    line-height: 1;
    opacity: .75;
    font-weight: 700;
}

.balance-box strong {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    font-weight: 900;
}

.btn-small,
.btn,
button {
    border: 0;
    cursor: pointer;
    background: linear-gradient(135deg, var(--green), var(--green2));
    color: #fff;
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

/* LAYOUT */
.container {
    width: min(1060px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.hero {
    background: linear-gradient(135deg, var(--green), var(--green2));
    color: #fff;
    padding: 22px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    box-shadow: 0 18px 36px rgba(0,0,0,.12);
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 24px;
    letter-spacing: -0.4px;
}

.hero p {
    margin: 0;
    opacity: .92;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.card h3 {
    margin: 0 0 8px;
}

.card p {
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.quick-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 112px;
    transition: .2s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
}

.quick-card span {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: rgba(15,143,95,.10);
    color: var(--green2);
    display: grid;
    place-items: center;
    font-weight: 900;
}

.section-title {
    margin: 24px 0 12px;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

/* FORMS */
.form-box {
    width: min(430px, 100%);
    margin: 40px auto;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: var(--radius);
}

.form-box h1 {
    margin: 0 0 16px;
    font-size: 24px;
}

.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--muted);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: 12px;
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--green);
}

.full-btn {
    width: 100%;
}

/* TABLE */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.table th,
.table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(15,143,95,.1);
    color: var(--green);
}

.status.pendente {
    background: rgba(217,119,6,.1);
    color: var(--warning);
}

.status.recusado {
    background: rgba(220,38,38,.1);
    color: var(--danger);
}

/* INVESTMENT CARDS */
.invest-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
    gap: 18px;
    margin-bottom: 28px;
}

.invest-product-card {
    position: relative;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% -20%, rgba(255,255,255,.08), transparent 48%),
        linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
    border: 1px solid var(--border);
    box-shadow:
        0 20px 42px rgba(0,0,0,.26),
        inset 0 1px 0 rgba(255,255,255,.04);
    transition: .22s ease;
}

.invest-product-card:hover {
    transform: translateY(-3px);
}

.invest-product-image {
    padding: 14px 14px 0;
}

.invest-product-image img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: block;
    border-radius: 18px;
    background: rgba(0,0,0,.20);
}

.invest-product-body {
    padding: 15px;
}

.invest-product-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.invest-product-top span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.invest-product-top strong {
    color: var(--green2);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.invest-product-card h3 {
    margin: 0 0 7px;
    font-size: 23px;
    line-height: 1.1;
    color: var(--text);
    letter-spacing: -0.4px;
}

.invest-product-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.invest-product-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.invest-product-row div,
.invest-product-result {
    padding: 11px 12px;
    border-radius: 15px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--border);
}

.invest-product-row small,
.invest-product-result small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .2px;
}

.invest-product-row b,
.invest-product-result b {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.invest-product-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.invest-product-result small {
    margin: 0;
}

.invest-product-result b {
    font-size: 17px;
    color: var(--green2);
}

.invest-product-btn {
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green), var(--green2));
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(0,0,0,.18);
}

/* TOAST / POPUP */
.toast {
    position: fixed;
    left: 50%;
    bottom: 92px;
    transform: translateX(-50%) translateY(20px);
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0,0,0,.16);
    opacity: 0;
    pointer-events: none;
    transition: .25s;
    z-index: 200;
    max-width: 92%;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.popup-overlay.active {
    display: flex;
}

.popup {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-width: 420px;
    width: 100%;
    padding: 20px;
}

.popup h2 {
    margin: 0 0 10px;
}

.popup p {
    color: var(--muted);
    line-height: 1.5;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 68px;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: none;
    grid-template-columns: repeat(4, 1fr);
    z-index: 60;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
}

.bottom-nav span {
    font-size: 18px;
    color: var(--green);
}

/* RESPONSIVE */
@media (max-width: 820px) {
    body {
        padding-bottom: 82px;
    }

    .desktop-nav {
        display: none;
    }

    .bottom-nav {
        display: grid;
    }

    .topbar {
        min-height: 68px;
        padding: 0 10px;
        gap: 8px;
    }

    .brand {
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .brand-logo {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        max-width: 46px !important;
        max-height: 46px !important;
    }

    .brand strong {
        font-size: 18px;
        max-width: 115px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .top-actions {
        gap: 6px;
    }

    .balance-box {
        min-width: 74px;
        height: 38px;
        padding: 5px 8px;
        border-radius: 12px;
        align-items: center;
    }

    .balance-box .balance-label {
        font-size: 9px;
    }

    .balance-box strong {
        font-size: 11px;
    }

    .btn-small {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 13px;
    }

    .container {
        padding: 14px;
    }

    .hero {
        padding: 20px;
    }

    .hero h1 {
        font-size: 21px;
    }

    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .invest-list {
        grid-template-columns: 1fr;
    }

    .invest-product-card {
        max-width: 100%;
    }

    .invest-product-image img {
        height: 145px;
    }
}

@media (max-width: 520px) {
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .quick-card {
        min-height: 104px;
    }

    .invest-product-row {
        grid-template-columns: 1fr 1fr;
    }

    .table {
        min-width: 520px;
    }
}

@media (max-width: 380px) {
    .brand strong {
        max-width: 90px;
        font-size: 16px;
    }

    .balance-box {
        min-width: 66px;
        padding: 5px 6px;
    }

    .balance-box strong {
        font-size: 10px;
    }

    .invest-product-row {
        grid-template-columns: 1fr;
    }
}

.quick-icon{
    width:42px;
    height:42px;

    border-radius:14px;

    display:flex;
    align-items:center;
    justify-content:center;

    background:rgba(255,255,255,.04);

    color:var(--green2);
}

.quick-icon svg{
    width:20px;
    height:20px;
}

.bottom-nav a svg{
    width:22px;
    height:22px;
}

.bottom-nav a{
    gap:5px;
}

.bottom-nav span{
    font-size:11px;
}

.bottom-nav a svg,
.quick-icon svg{
    stroke-linecap:round;
    stroke-linejoin:round;
}

.quick-card span:not(.quick-icon){
    width:auto;
    height:auto;
    background:none;
    border-radius:0;
    display:inline;
}

.quick-icon{
    width:42px !important;
    height:42px !important;

    min-width:42px;

    border-radius:14px;

    display:flex !important;
    align-items:center;
    justify-content:center;

    background:rgba(255,255,255,.04) !important;

    color:var(--green2);

    padding:0 !important;
}

.quick-icon svg{
    width:20px;
    height:20px;
}

.contract-box{
    margin-bottom:22px;
    padding:18px;

    border-radius:24px;

    background:
        radial-gradient(circle at top, rgba(255,255,255,.07), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));

    border:1px solid var(--border);

    box-shadow:
        0 18px 42px rgba(0,0,0,.24),
        inset 0 1px 0 rgba(255,255,255,.04);
}

.contract-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;

    margin-bottom:16px;
}

.contract-header span{
    color:var(--muted);
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
}

.contract-header h2{
    margin:4px 0 0;
    font-size:24px;
    color:var(--text);
}

.contract-header strong{
    padding:10px 14px;
    border-radius:16px;

    background:linear-gradient(135deg, var(--green), var(--green2));
    color:#fff;

    font-weight:900;
    white-space:nowrap;
}

.contract-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:10px;

    margin-bottom:16px;
}

.contract-grid div{
    padding:13px;

    border-radius:16px;

    background:rgba(255,255,255,.035);
    border:1px solid var(--border);
}

.contract-grid small{
    display:block;
    color:var(--muted);
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    margin-bottom:5px;
}

.contract-grid b{
    color:var(--text);
    font-size:15px;
}

.contract-btn{
    width:100%;
    height:50px;

    border-radius:16px;

    background:linear-gradient(135deg, var(--green), var(--green2));

    color:#fff;
    font-weight:900;
}

@media(max-width:820px){
    .contract-grid{
        grid-template-columns:1fr 1fr;
    }
}

@media(max-width:420px){
    .contract-header{
        flex-direction:column;
    }

    .contract-grid{
        grid-template-columns:1fr;
    }
}

.my-invest-list{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
    gap:14px;
    margin-bottom:28px;
}

.my-invest-card{
    padding:16px;
    border-radius:22px;
    background:var(--card);
    border:1px solid var(--border);
    box-shadow:0 14px 32px rgba(0,0,0,.12);
}

.my-invest-label{
    display:inline-block;
    margin-bottom:8px;
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    color:var(--muted);
}

.my-invest-card h3{
    margin:0 0 14px;
    font-size:20px;
}

.my-invest-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
}

.my-invest-grid div{
    padding:12px;
    border-radius:15px;
    background:rgba(255,255,255,.04);
    border:1px solid var(--border);
}

.my-invest-grid small{
    display:block;
    color:var(--muted);
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    margin-bottom:5px;
}

.my-invest-grid strong{
    font-size:14px;
}

.empty-box{
    padding:18px;
    border-radius:20px;
    background:var(--card);
    border:1px solid var(--border);
}

.empty-box p{
    color:var(--muted);
    margin:6px 0 0;
}

@media(max-width:520px){
    .my-invest-grid{
        grid-template-columns:1fr;
    }
}