@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1D367F; /* Pisom Royal Blue */
    --hover-color: #162a63;
    --primary: #1D367F;
    --primary-light: #38bdf8;
    --accent: #d4af37;
    --accent-soft: rgba(212, 175, 55, 0.15);
    --bg-overlay: rgba(15, 23, 42, 0.7); 
    --glass-bg: #E4E4E8;
    --glass-border: rgba(226, 232, 240, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --input-bg: #f1f5f9;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-600: #475569;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --green: #10b981;
    --blue: #1D367F;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 50%, rgba(16,185,129,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(52,211,153,0.1) 0%, transparent 60%),
                var(--slate-900);
    overflow: auto;
    padding: 2rem 0;
}

/* Overlay redundant with radial gradient but kept for subtle refinement if needed */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent, rgba(15, 23, 42, 0.3));
    z-index: 1;
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 240px;
    height: auto;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    border-radius: 0;
}

.logo svg {
    width: 100%;
    height: 100%;
    fill: white;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

.input-wrapper {
    position: relative;
}

input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--input-bg);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 54, 127, 0.12);
}

.form-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    width: auto;
    cursor: pointer;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--hover-color);
}

button.login-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(29, 54, 127, 0.25);
    position: relative;
    overflow: hidden;
}

button.login-btn:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(29, 54, 127, 0.35);
}

button.login-btn:active {
    transform: translateY(0);
}

.footer-text {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    background-color: var(--input-bg);
    margin: 0;
    font: inherit;
    color: var(--primary-color);
    width: 1.15em;
    height: 1.15em;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--primary-color);
    background-color: CanvasText;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:checked {
    border-color: var(--primary-color);
}

/* Micro-interactions */
.form-group:focus-within label {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container {
        max-width: 90%;
        padding: 2rem 1.5rem;
    }
}


/* DASHBOARD STYLES */

        @keyframes pulse {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            50% {
                transform: scale(1.1);
                opacity: 0.8;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        :root {
            --primary: #064e3b;
            --primary-light: #10b981;
            --accent: #10b981;
            --accent-soft: rgba(16, 185, 129, 0.1);
            --danger: #ef4444;
            --warning: #f59e0b;
            --slate-50: #f8fafc;
            --slate-100: #f1f5f9;
            --slate-200: #e2e8f0;
            --slate-400: #94a3b8;
            --slate-600: #475569;
            --slate-800: #f8fafc;
            /* Um branco levemente acinzentado para não cansar a vista */
            /* #1e293b */
            --slate-900: #091635;
            /* #0f172a #091635ff #a3a6adff*/
            --glass: rgba(255, 255, 255, 0.8);
            --glass-border: rgba(255, 255, 255, 0.5);
            --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        /* Grid de Perfil Responsiva */
        .perfil-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            max-width: 1000px;
            gap: 1.5rem;
        }

        @media (max-width: 768px) {
            .perfil-grid {
                grid-template-columns: 1fr;
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in {
            animation: fadeInUp 0.6s ease-out both;
        }

        .delay-1 {
            animation-delay: 0.1s;
        }

        .delay-2 {
            animation-delay: 0.2s;
        }

        .delay-3 {
            animation-delay: 0.3s;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background: var(--slate-900);
            min-height: 100vh;
            min-height: 100dvh;
            overflow-x: hidden;
            overflow-y: auto;
            color: #1e293b;
        }

        body::before {
            display: none;
        }

        /* ─── Sidebar ─── */
        .layout {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: 260px;
            background: #E4E4E8;
            padding: 0;
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 100;
            border-right: 1px solid #e2e8f0;
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
        }

        .sidebar-logo {
            background: #E4E4E8;
            display: flex;
            align-items: stretch;
            justify-content: center;
            padding: 0;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            overflow: hidden;
        }

        .sidebar-logo img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: cover;
        }

        .sidebar-logo-icon {
            width: 42px;
            height: 42px;
            background: linear-gradient(135deg, #10b981, #059669);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
        }

        .sidebar-logo-text {
            color: #1e293b;
            font-weight: 700;
            font-size: 1rem;
        }

        .sidebar-logo-text span {
            color: #059669;
        }

        .nav-section {
            margin-bottom: 1.5rem;
        }

        .nav-label {
            color: #94a3b8;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            margin-bottom: 0.5rem;
            padding: 0 0.75rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.72rem 0.85rem;
            margin-bottom: 0.15rem;
            border-radius: 8px;
            color: #475569;
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.18s ease;
            cursor: pointer;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }

        .nav-item:hover {
            background: #f1f5f9;
            color: #1e293b;
        }

        .nav-item.active {
            background: rgba(5, 150, 105, 0.1);
            color: #059669;
            font-weight: 600;
        }

        .nav-item .icon {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
        }

        .sidebar-bottom {
            margin-top: auto;
            padding: 1.5rem 1.25rem 2rem;
            border-top: 1px solid #e2e8f0;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, #059669, #047857);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 0.875rem;
        }

        .sidebar-user {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .sidebar-user-name {
            color: #1e293b;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .sidebar-user-role {
            color: #94a3b8;
            font-size: 0.75rem;
        }

        /* ─── Main Content ─── */
        .main {
            margin-left: 260px;
            padding: 2rem 1.5rem;
            background: #0f172a;
            min-height: 100vh;
        }

        /* ─── Tab Navigation ─── */
        .tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--slate-200);
        }

        .tab-btn {
            padding: 0.75rem 1.5rem;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 600;
            color: #64748b;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
            border-radius: 8px 8px 0 0;
        }

        .tab-btn.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        .tab-btn:hover {
            background: rgba(255, 255, 255, 0.05);
            color: white;
        }

        .tab-panel {
            display: none;
        }

        .tab-panel.active {
            display: block;
        }

        /* ─── Header ─── */
        .page-header {
            background: linear-gradient(135deg, #0f2318 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem 2.5rem;
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .page-header h1 {
            color: white;
            font-size: 1.5rem;
            font-weight: 800;
        }

        .page-header p {
            color: #94a3b8;
            font-size: 0.875rem;
            margin-top: 0.25rem;
        }

        .header-badge {
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.3);
            color: #10b981;
            padding: 0.5rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* ─── Cards ─── */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: #FFFFFF;
            padding: 1.5rem;
            border-radius: 10px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            border: 1px solid var(--slate-200);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
        }

        .stat-card-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            margin-bottom: 1rem;
        }

        .stat-card h3 {
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .stat-card .value {
            font-size: 1.5rem;
            font-weight: 800;
            color: #1e293b;
        }

        .stat-card .sub {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 0.25rem;
        }

        /* ─── Cards de seção ─── */
        .card {
            background: #FFFFFF;
            border-radius: 12px;
            padding: 1.75rem 2rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 1px solid var(--slate-200);
            margin-bottom: 2rem;
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--slate-100);
        }

        .card-header h2 {
            font-size: 1rem;
            font-weight: 700;
            color: #1e293b;
        }

        .card-badge {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
        }

        /* ─── Tabelas ─── */
        .table-wrapper {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            padding: 0.5rem 0.4rem;
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--slate-50);
            border-bottom: 1px solid var(--slate-200);
        }

        th:first-child {
            border-radius: 2px 0 0 2px;
        }

        th:last-child {
            border-radius: 0 2px 2px 0;
        }

        td {
            padding: 0.6rem 0.4rem;
            color: var(--slate-600);
            border-bottom: 1px solid var(--slate-200);
            font-size: 0.875rem;
            transition: background 0.2s;
        }

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

        tr:hover td {
            background: var(--slate-50);
        }

        /* ─── Badges ─── */
        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-pending {
            background: var(--gold-light);
            color: #92400e;
        }

        .badge-success {
            background: var(--green-light);
            color: var(--green-dark);
        }

        .badge-info {
            background: #d1fae5;
            color: #065f46;
        }

        .badge-admin {
            background: #d1fae5;
            color: #064e3b;
        }

        /* ─── Alertas ─── */
        .alert {
            padding: 1rem 1.25rem;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .alert-success {
            background: #FFFFFF;
            color: var(--green-dark);
            border-left: 4px solid var(--green);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        .alert-error {
            background: #FFFFFF;
            color: #991b1b;
            border-left: 4px solid var(--red);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        /* ─── Admin Panel ─── */
        .admin-panel {
            background: linear-gradient(135deg, #0a1a0e 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem;
            margin-bottom: 2rem;
        }

        .admin-panel-title {
            color: white;
            font-size: 1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .admin-controls {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
            align-items: flex-end;
        }

        .admin-field label {
            display: block;
            margin-bottom: 0.5rem;
            font-size: 0.8rem;
            color: #94a3b8;
            font-weight: 500;
        }

        .admin-input {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            width: 160px;
            outline: none;
            transition: all 0.2s;
        }

        .admin-input:focus {
            border-color: #10b981;
            background: rgba(255, 255, 255, 0.12);
        }

        .admin-btn {
            padding: 0.625rem 1.5rem;
            border-radius: 2px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .admin-btn-green {
            background: #10b981;
            color: white;
        }

        .admin-btn-green:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        .admin-btn-blue {
            background: #10b981;
            color: white;
        }

        .admin-btn-blue:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        /* ─── Switch ─── */
        .switch {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #475569;
            transition: .3s;
            border-radius: 28px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background: white;
            transition: .3s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background: #10b981;
        }

        input:checked+.slider:before {
            transform: translateX(24px);
        }

        /* ─── Invest Form ─── */
        .invest-form {
            display: grid;
            grid-template-columns: 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        /* ─── Chart ─── */
        .chart-container {
            position: relative;
            height: 400px;
        }

        /* ─── Investimento Tab: Mesma largura do Extrato ─── */
        #panel-investimentos .premium-hero,
        #panel-investimentos .card {
            width: 100%;
            max-width: none !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            box-sizing: border-box;
        }

        /* ─── Movimentar Buttons ─── */
        .mover-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            max-width: 480px;
            margin: 2rem auto;
        }

        .mover-btn {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-radius: 14px;
            text-decoration: none;
            font-weight: 700;
            font-size: 1rem;
            transition: all 0.25s;
            color: white;
        }

        .mover-btn:hover {
            transform: translateY(-3px);
            filter: brightness(1.1);
        }

        .mover-btn:active { transform: scale(0.97); }

        .mover-btn .mover-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            flex-shrink: 0;
        }

        .mover-btn-aporte  { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 8px 20px -4px rgba(16,185,129,0.4); }
        .mover-btn-retirar { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 8px 20px -4px rgba(239,68,68,0.4); }
        .mover-btn-chat    { background: linear-gradient(135deg, #25d366, #20b958); box-shadow: 0 8px 20px -4px rgba(37,211,102,0.4); }

        /* ─── Info pill ─── */
        .rate-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border: 1px solid #6ee7b7;
            color: #065f46;
            padding: 0.4rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 700;
        }

        /* ─── Add Saldo Form (admin) ─── */
        .add-saldo-form {
            display: grid;
            grid-template-columns: 1fr 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        .add-saldo-form input,
        .add-saldo-form select {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            outline: none;
        }

        .add-saldo-form input::placeholder {
            color: #64748b;
        }

        .add-saldo-form select option {
            background: #1e293b;
            color: white;
        }

        /* ─── Logout ─── */
        .logout-link {
            color: #ef4444;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logout-link:hover {
            opacity: 0.8;
        }

        /* ─── Empty State ─── */
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--slate-600);
        }

        .empty-state .empty-icon {
            font-size: 2.5rem;
            margin-bottom: 0.75rem;
        }

        .empty-state p {
            font-size: 0.875rem;
        }

        /* ─── Mobile Elements ─── */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: #E4E4E8;
            padding: 0 1.25rem;
            align-items: center;
            justify-content: space-between;
            z-index: 101;
            border-bottom: 1px solid var(--slate-200);
        }

        .bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 90px; /* Aumentado de 80px */
            background: #FFFFFF;
            border-top: 1px solid var(--slate-200);
            display: none;
            grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* Garante divisão igual */
            align-items: center;
            padding-bottom: env(safe-area-inset-bottom);
            z-index: 101;
            box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: var(--slate-600);
            text-decoration: none;
            font-size: 0.7rem;
            font-weight: 500;
            background: none;
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            padding: 0.5rem 0; /* Aumentado para melhor toque */
        }

        .bottom-nav-item .icon {
            font-size: 1.6rem; /* Reduzido de 2.2rem para melhor equilíbrio */
            line-height: 1;
        }

        .bottom-nav-item.active {
            color: #10b981;
        }

        /* ─── Responsive (Tablet & Mobile) ─── */
        @media (max-width: 1024px) {
            .main {
                padding: 2.25rem 1.75rem;
            }
            .card {
                padding: 1.5rem 1.75rem;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            .mobile-header {
                display: flex;
            }

            .bottom-nav {
                display: grid;
            }

            .main {
                margin-left: 0;
                padding: 5.5rem 1.25rem 9rem;
                width: 100%;
                overflow-x: hidden;
            }

            .invest-form,
            .add-saldo-form {
                grid-template-columns: 1fr;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
                gap: 1rem;
            }

            .page-header {
                padding: 1.5rem;
                flex-direction: column;
                text-align: center;
                gap: 1rem;
            }

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

            .admin-input {
                width: 100% !important;
            }

            .add-saldo-form input,
            .add-saldo-form select {
                width: 100%;
            }

            /* Responsive Tables (Card View) */
            .responsive-table thead {
                display: none;
            }

            .responsive-table tr {
                display: block;
                background: #FFFFFF;
                border: 1px solid var(--slate-200);
                padding: 1rem;
                border-radius: 12px;
                margin-bottom: 1rem;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
            }

            .responsive-table td {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.5rem 0;
                text-align: right;
                border-bottom: 1px solid var(--slate-100);
            }

            .responsive-table td:last-child {
                border-bottom: none;
                padding-bottom: 0;
                margin-bottom: 0;
            }

            .responsive-table td::before {
                content: attr(data-label);
                font-weight: 700;
                color: var(--slate-600);
                font-size: 0.75rem;
                text-transform: uppercase;
                text-align: left;
            }

            .responsive-table .empty-state tr {
                border: none;
                background: transparent;
                box-shadow: none;
            }

            /* Ajustes Finos de Proporção Pisom Mobile */
            .sheet-header-card {
                flex-direction: column;
                border-width: 1px;
            }

            .sheet-logo-brand {
                min-width: 100%;
                border-right: 0;
                border-bottom: 1px solid #e2e8f0;
                padding: 1.25rem;
            }

            .sheet-header-metrics {
                grid-template-columns: 1fr;
            }

            .metric-box {
                padding: 0.6rem 1rem;
                border-right: 0;
            }

            .metric-value {
                font-size: 0.85rem;
            }

            .metric-highlight {
                font-size: 1rem;
            }

            .sheet-table td {
                padding: 0.5rem 0.75rem;
                font-size: 0.75rem;
            }

            .sheet-table thead th {
                padding: 0.75rem 0.5rem !important;
                font-size: 0.65rem;
            }
        }

        /* ─── Premium Mobile-First UI ─── */
        .premium-hero {
            background: linear-gradient(135deg, #047857 0%, #059669 100%);
            border-radius: 20px;
            padding: 3.5rem 4rem;
            position: relative;
            overflow: hidden;
            color: white;
            margin-bottom: 2.5rem;
            box-shadow: 0 25px 50px -12px rgba(5, 150, 105, 0.4);
            margin-top: 1rem;
        }

        .premium-hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            blur: 60px;
            pointer-events: none;
        }

        .hero-label {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            opacity: 0.7;
            margin-bottom: 0.5rem;
        }

        .hero-amount {
            font-size: 2.5rem;
            font-weight: 800;
            letter-spacing: -0.02em;
            margin-bottom: 1.5rem;
        }

        .hero-amount span {
            font-size: 1.25rem;
            opacity: 0.6;
            margin-right: 4px;
            font-weight: 600;
        }

        .hero-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 1.5rem;
        }

        .hero-item-label {
            font-size: 0.65rem;
            font-weight: 600;
            opacity: 0.6;
            text-transform: uppercase;
            margin-bottom: 0.25rem;
        }

        .hero-item-value {
            font-size: 0.9rem;
            font-weight: 700;
        }

        /* Monthly Performance Cards (Mobile) */
        .performance-feed {
            display: none;
            flex-direction: column;
            gap: 1rem;
        }

        .performance-card {
            background: #FFFFFF;
            border-radius: 10px;
            padding: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 2px solid transparent;
            transition: all 0.2s;
        }

        /* Destaque Mês Atual */
        .performance-card.current {
            border-color: #d4af37 !important;
            background: #fffbeb !important;
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15) !important;
        }

        .performance-card.current .perf-month {
            color: #92400e !important;
        }

        .performance-card:active {
            transform: scale(0.98);
        }

        .perf-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .perf-icon {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
        }

        .perf-month {
            font-weight: 700;
            color: #1e293b;
            font-size: 0.95rem;
        }

        .perf-meta {
            font-size: 0.7rem;
            color: var(--slate-600);
            margin-top: 2px;
        }

        .perf-value {
            text-align: right;
        }

        .perf-profit {
            color: var(--accent);
            font-weight: 800;
            font-size: 0.95rem;
        }

        .perf-total {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 2px;
            font-weight: 500;
        }

        @media (max-width: 768px) {
            .sheet-table {
                display: none;
            }

            .performance-feed {
                display: flex;
            }

            .hero-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem 0.75rem;
            }

            .hero-amount {
                font-size: 2rem;
                margin-bottom: 2rem;
            }

            .premium-hero {
                padding: 1.5rem 1rem;
                border-radius: 10px;
                margin-top: 0.5rem;
                max-width: 100%;
                width: 100%;
                margin-left: 0;
                margin-right: 0;
            }

            .hero-item-value {
                font-size: 0.8rem;
            }

            .hero-item-label {
                font-size: 0.55rem;
                letter-spacing: 0.02em;
            }

            /* Ajustes nos cards de performance para evitar quebra de linha */
            .performance-card {
                padding: 1rem 0.75rem;
            }

            .perf-icon {
                width: 36px;
                height: 36px;
                font-size: 0.9rem;
            }

            .perf-month {
                font-size: 0.82rem;
            }

            .perf-profit {
                font-size: 0.82rem;
            }

            .perf-total {
                font-size: 0.68rem;
            }
        }

        /* ─── Export Button Style ─── */
        .export-section {
            margin-top: 3rem;
            text-align: center;
            padding: 2rem;
            background: white;
            border-radius: 10px;
            border: 1px dashed var(--slate-200);
        }

        .btn-export {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            background: var(--slate-900);
            color: white;
            padding: 1rem 2rem;
            border-radius: 10px;
            text-decoration: none;
            font-weight: 700;
            transition: all 0.3s;
        }

        .btn-export:hover {
            background: #000;
            transform: translateY(-2px);
        }

        /* Ajustes do Modal de Extrato no Mobile */
        @media (max-width: 768px) {
            #modal-extrato > div {
                max-height: 98vh !important;
                width: 95% !important;
                padding: 0 !important;
            }

            #modal-extrato .modal-header {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container form {
                gap: 0.5rem !important;
            }

            /* Estabilização do Painel Administrativo */
            .card-header {
                padding: 1rem !important;
            }

            .card-header > div:last-child {
                min-width: 100% !important; /* Evita quebra de layout no mobile */
                gap: 0.75rem !important;
            }

            /* Garante que nada transborde lateralmente */
            .main, .layout, body {
                overflow-x: hidden !important;
                max-width: 100vw;
            }

            #modal-extrato .modal-table-container {
                max-height: none !important;
                flex: 1;
                overflow-y: auto;
                min-height: 250px !important;
                border-top: 1px solid #eee;
            }

            #modal-extrato .sheet-table {
                display: table !important; /* Sobrescreve o display:none global */
                font-size: 0.7rem !important;
            }

            #modal-extrato .sheet-table th,
            #modal-extrato .sheet-table td {
                padding: 0.5rem 0.25rem !important;
            }

            #modal-extrato .sheet-table input,
            #modal-extrato .sheet-table select {
                padding: 0.25rem !important;
                font-size: 0.7rem !important;
                width: auto !important;
                max-width: 80px;
            }

            /* Ajustes nos controles do painel no Mobile */
            #sort-investor {
                width: 100% !important;
                order: 2;
            }
            #search-investor {
                width: 100% !important;
                order: 1;
            }
            .card-header button {
                width: 100% !important;
                order: 3;
            }
        }

        @media print {

            .sidebar,
            .mobile-header,
            .bottom-nav,
            .btn-export,
            #investChart,
            .card-header .badge {
                display: none !important;
            }

            .main {
                margin-left: 0 !important;
                padding: 0 !important;
            }

            .premium-hero {
                background: white !important;
                color: black !important;
                border: 2px solid black;
                box-shadow: none;
            }

            .hero-amount,
            .hero-item-value,
            .perf-profit {
                color: black !important;
            }

            .sheet-table {
                display: table !important;
                width: 100% !important;
                border: 1px solid #ddd !important;
            }

            .performance-feed {
                display: none !important;
            }
        }

        /* ─── Spreadsheet Styles (Desktop only refined) ─── */
        @media (min-width: 769px) {
            .sheet-table {
                width: 100%;
                border-collapse: separate;
                border-spacing: 0;
                background: white;
                border-radius: 2px;
                overflow: hidden;
                box-shadow: var(--shadow-premium);
                border: 1px solid rgba(255,255,255,0.08);
            }

            .sheet-table thead th {
                background: #f8fafc;
                color: var(--slate-600);
                text-transform: uppercase;
                font-size: 0.7rem;
                font-weight: 700;
                padding: 1.25rem 1rem;
                border-bottom: 2px solid var(--slate-100);
                text-align: left;
            }

            .sheet-table td {
                padding: 1rem;
                border-bottom: 1px solid var(--slate-50);
                color: var(--slate-800);
            }

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

            .sheet-table tr:hover td {
                background: #fdfdfd;
            }

            .total-row {
                background: #f8fafc;
                font-weight: 800;
            }
        }

        /* ─── Tablet ─── */
        @media (min-width: 769px) and (max-width: 1200px) {
            .sidebar {
                width: 110px;
                padding: 0.5rem 0.25rem;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .sidebar-bottom {
                padding: 0.5rem 0.25rem 1rem;
            }

            .sidebar-logo>div:not(.sidebar-logo-icon),
            .nav-label {
                display: none;
            }

            .sidebar-user-name,
            .sidebar-user-role {
                display: block;
                font-size: 0.6rem;
                text-align: center;
                margin-top: 2px;
            }

            .sidebar-logo {
                justify-content: center;
                padding: 1rem 0.25rem;
                min-height: auto;
                margin-bottom: 1rem;
                border-bottom: 1px solid var(--slate-100);
            }

            .sidebar-logo img {
                max-width: 80px;
                height: auto;
            }

            .nav-item {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                padding: 0.5rem 0.25rem;
                font-size: 0.65rem;
                text-align: center;
                gap: 0.25rem;
                border-radius: 8px;
            }

            .nav-item .icon {
                font-size: 1.4rem;
                width: auto;
                margin: 0;
            }

            .main {
                margin-left: 110px;
                padding: 3rem 2rem;
            }

            /* Investimento ocupa toda a largura no tablet */
            #panel-investimentos .premium-hero,
            #panel-investimentos .card {
                width: 100% !important;
                max-width: none !important;
                margin-left: 0 !important;
                margin-right: 0 !important;
            }

            .sidebar-user {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                text-align: center;
            }

            .logout-link {
                justify-content: center;
                align-items: center;
                flex-direction: column;
                font-size: 0.7rem;
                gap: 4px;
                margin-top: 0.5rem !important;
            }

            .logout-link::before {
                display: none;
            }

            /* Ajustes do painel administrativo no tablet */
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.5rem;
            }

            .add-saldo-form {
                grid-template-columns: 1fr 1fr;
                gap: 1.5rem;
            }

            .add-saldo-form div:nth-child(3) {
                grid-column: span 2;
            }

            /* Descrição ocupa linha toda */
            .add-saldo-form div:last-child {
                grid-column: span 2;
                text-align: right;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .admin-input {
                width: 100% !important;
            }

            .card {
                padding: 1.25rem 0.75rem !important;
                /* Reduz a distância entre a tabela e a borda do card */
            }

            .table-wrapper {
                margin: 0 -0.60rem;
                padding: 0;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .sheet-table th,
            .sheet-table td {
                font-size: 0.75rem !important;
                /* Tamanho reduzido para caber no tablet */
            }
        }
    

/* DASHBOARD STYLES */

        @keyframes pulse {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            50% {
                transform: scale(1.1);
                opacity: 0.8;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        :root {
            --primary: #064e3b;
            --primary-light: #10b981;
            --accent: #10b981;
            --accent-soft: rgba(16, 185, 129, 0.1);
            --danger: #ef4444;
            --warning: #f59e0b;
            --slate-50: #f8fafc;
            --slate-100: #f1f5f9;
            --slate-200: #e2e8f0;
            --slate-400: #94a3b8;
            --slate-600: #475569;
            --slate-800: #f8fafc;
            /* Um branco levemente acinzentado para não cansar a vista */
            /* #1e293b */
            --slate-900: #091635;
            /* #0f172a #091635ff #a3a6adff*/
            --glass: rgba(255, 255, 255, 0.8);
            --glass-border: rgba(255, 255, 255, 0.5);
            --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        /* Grid de Perfil Responsiva */
        .perfil-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            max-width: 1000px;
            gap: 1.5rem;
        }

        @media (max-width: 768px) {
            .perfil-grid {
                grid-template-columns: 1fr;
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in {
            animation: fadeInUp 0.6s ease-out both;
        }

        .delay-1 {
            animation-delay: 0.1s;
        }

        .delay-2 {
            animation-delay: 0.2s;
        }

        .delay-3 {
            animation-delay: 0.3s;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background: var(--slate-900);
            min-height: 100vh;
            min-height: 100dvh;
            overflow-x: hidden;
            overflow-y: auto;
            color: #1e293b;
        }

        body::before {
            display: none;
        }

        /* ─── Sidebar ─── */
        .layout {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: 260px;
            background: #E4E4E8;
            padding: 0;
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 100;
            border-right: 1px solid #e2e8f0;
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
        }

        .sidebar-logo {
            background: #E4E4E8;
            display: flex;
            align-items: stretch;
            justify-content: center;
            padding: 0;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            overflow: hidden;
        }

        .sidebar-logo img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: cover;
        }

        .sidebar-logo-icon {
            width: 42px;
            height: 42px;
            background: linear-gradient(135deg, #10b981, #059669);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
        }

        .sidebar-logo-text {
            color: #1e293b;
            font-weight: 700;
            font-size: 1rem;
        }

        .sidebar-logo-text span {
            color: #059669;
        }

        .nav-section {
            margin-bottom: 1.5rem;
        }

        .nav-label {
            color: #94a3b8;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            margin-bottom: 0.5rem;
            padding: 0 0.75rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.72rem 0.85rem;
            margin-bottom: 0.15rem;
            border-radius: 8px;
            color: #475569;
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.18s ease;
            cursor: pointer;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }

        .nav-item:hover {
            background: #f1f5f9;
            color: #1e293b;
        }

        .nav-item.active {
            background: rgba(5, 150, 105, 0.1);
            color: #059669;
            font-weight: 600;
        }

        .nav-item .icon {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
        }

        .sidebar-bottom {
            margin-top: auto;
            padding: 1.5rem 1.25rem 2rem;
            border-top: 1px solid #e2e8f0;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, #059669, #047857);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 0.875rem;
        }

        .sidebar-user {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .sidebar-user-name {
            color: #1e293b;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .sidebar-user-role {
            color: #94a3b8;
            font-size: 0.75rem;
        }

        /* ─── Main Content ─── */
        .main {
            margin-left: 260px;
            padding: 2.5rem;
            background: #0f172a;
            min-height: 100vh;
        }

        /* ─── Tab Navigation ─── */
        .tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--slate-200);
        }

        .tab-btn {
            padding: 0.75rem 1.5rem;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 600;
            color: #64748b;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
            border-radius: 8px 8px 0 0;
        }

        .tab-btn.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        .tab-btn:hover {
            background: rgba(255, 255, 255, 0.05);
            color: white;
        }

        .tab-panel {
            display: none;
        }

        .tab-panel.active {
            display: block;
        }

        /* ─── Header ─── */
        .page-header {
            background: linear-gradient(135deg, #0f2318 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem 2.5rem;
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .page-header h1 {
            color: white;
            font-size: 1.5rem;
            font-weight: 800;
        }

        .page-header p {
            color: #94a3b8;
            font-size: 0.875rem;
            margin-top: 0.25rem;
        }

        .header-badge {
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.3);
            color: #10b981;
            padding: 0.5rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* ─── Cards ─── */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: #FFFFFF;
            padding: 1.5rem;
            border-radius: 10px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            border: 1px solid var(--slate-200);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
        }

        .stat-card-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            margin-bottom: 1rem;
        }

        .stat-card h3 {
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .stat-card .value {
            font-size: 1.5rem;
            font-weight: 800;
            color: #1e293b;
        }

        .stat-card .sub {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 0.25rem;
        }

        /* ─── Cards de seção ─── */
        .card {
            background: #FFFFFF;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 1px solid var(--slate-200);
            margin-bottom: 2rem;
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--slate-100);
        }

        .card-header h2 {
            font-size: 1rem;
            font-weight: 700;
            color: #1e293b;
        }

        .card-badge {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
        }

        /* ─── Tabelas ─── */
        .table-wrapper {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            padding: 0.5rem 0.4rem;
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--slate-50);
            border-bottom: 1px solid var(--slate-200);
        }

        th:first-child {
            border-radius: 2px 0 0 2px;
        }

        th:last-child {
            border-radius: 0 2px 2px 0;
        }

        td {
            padding: 0.6rem 0.4rem;
            color: var(--slate-600);
            border-bottom: 1px solid var(--slate-200);
            font-size: 0.875rem;
            transition: background 0.2s;
        }

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

        tr:hover td {
            background: var(--slate-50);
        }

        /* ─── Badges ─── */
        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-pending {
            background: var(--gold-light);
            color: #92400e;
        }

        .badge-success {
            background: var(--green-light);
            color: var(--green-dark);
        }

        .badge-info {
            background: #d1fae5;
            color: #065f46;
        }

        .badge-admin {
            background: #d1fae5;
            color: #064e3b;
        }

        /* ─── Alertas ─── */
        .alert {
            padding: 1rem 1.25rem;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .alert-success {
            background: #FFFFFF;
            color: var(--green-dark);
            border-left: 4px solid var(--green);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        .alert-error {
            background: #FFFFFF;
            color: #991b1b;
            border-left: 4px solid var(--red);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        /* ─── Admin Panel ─── */
        .admin-panel {
            background: linear-gradient(135deg, #0a1a0e 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem;
            margin-bottom: 2rem;
        }

        .admin-panel-title {
            color: white;
            font-size: 1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .admin-controls {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
            align-items: flex-end;
        }

        .admin-field label {
            display: block;
            margin-bottom: 0.5rem;
            font-size: 0.8rem;
            color: #94a3b8;
            font-weight: 500;
        }

        .admin-input {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            width: 160px;
            outline: none;
            transition: all 0.2s;
        }

        .admin-input:focus {
            border-color: #10b981;
            background: rgba(255, 255, 255, 0.12);
        }

        .admin-btn {
            padding: 0.625rem 1.5rem;
            border-radius: 2px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .admin-btn-green {
            background: #10b981;
            color: white;
        }

        .admin-btn-green:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        .admin-btn-blue {
            background: #10b981;
            color: white;
        }

        .admin-btn-blue:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        /* ─── Switch ─── */
        .switch {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #475569;
            transition: .3s;
            border-radius: 28px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background: white;
            transition: .3s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background: #10b981;
        }

        input:checked+.slider:before {
            transform: translateX(24px);
        }

        /* ─── Invest Form ─── */
        .invest-form {
            display: grid;
            grid-template-columns: 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        /* ─── Chart ─── */
        .chart-container {
            position: relative;
            height: 400px;
        }

        /* ─── Investimento Tab: Mesma largura do Extrato ─── */
        #panel-investimentos .premium-hero,
        #panel-investimentos .card {
            width: 100%;
            max-width: none !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            box-sizing: border-box;
        }

        /* ─── Movimentar Buttons ─── */
        .mover-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            max-width: 480px;
            margin: 2rem auto;
        }

        .mover-btn {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-radius: 14px;
            text-decoration: none;
            font-weight: 700;
            font-size: 1rem;
            transition: all 0.25s;
            color: white;
        }

        .mover-btn:hover {
            transform: translateY(-3px);
            filter: brightness(1.1);
        }

        .mover-btn:active { transform: scale(0.97); }

        .mover-btn .mover-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            flex-shrink: 0;
        }

        .mover-btn-aporte  { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 8px 20px -4px rgba(16,185,129,0.4); }
        .mover-btn-retirar { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 8px 20px -4px rgba(239,68,68,0.4); }
        .mover-btn-chat    { background: linear-gradient(135deg, #25d366, #20b958); box-shadow: 0 8px 20px -4px rgba(37,211,102,0.4); }

        /* ─── Info pill ─── */
        .rate-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border: 1px solid #6ee7b7;
            color: #065f46;
            padding: 0.4rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 700;
        }

        /* ─── Add Saldo Form (admin) ─── */
        .add-saldo-form {
            display: grid;
            grid-template-columns: 1fr 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        .add-saldo-form input,
        .add-saldo-form select {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            outline: none;
        }

        .add-saldo-form input::placeholder {
            color: #64748b;
        }

        .add-saldo-form select option {
            background: #1e293b;
            color: white;
        }

        /* ─── Logout ─── */
        .logout-link {
            color: #ef4444;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logout-link:hover {
            opacity: 0.8;
        }

        /* ─── Empty State ─── */
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--slate-600);
        }

        .empty-state .empty-icon {
            font-size: 2.5rem;
            margin-bottom: 0.75rem;
        }

        .empty-state p {
            font-size: 0.875rem;
        }

        /* ─── Mobile Elements ─── */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: #E4E4E8;
            padding: 0 1.25rem;
            align-items: center;
            justify-content: space-between;
            z-index: 101;
            border-bottom: 1px solid var(--slate-200);
        }

        .bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 90px; /* Aumentado de 80px */
            background: #FFFFFF;
            border-top: 1px solid var(--slate-200);
            display: none;
            grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* Garante divisão igual */
            align-items: center;
            padding-bottom: env(safe-area-inset-bottom);
            z-index: 101;
            box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: var(--slate-600);
            text-decoration: none;
            font-size: 0.7rem;
            font-weight: 500;
            background: none;
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            padding: 0.5rem 0; /* Aumentado para melhor toque */
        }

        .bottom-nav-item .icon {
            font-size: 1.6rem; /* Reduzido de 2.2rem para melhor equilíbrio */
            line-height: 1;
        }

        .bottom-nav-item.active {
            color: #10b981;
        }

        /* ─── Responsive ─── */
        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            .mobile-header {
                display: flex;
            }

            .bottom-nav {
                display: grid;
            }

            .main {
                margin-left: 0;
                padding: 5.5rem 0.75rem 9rem;
                width: 100%;
                overflow-x: hidden;
            }

            .invest-form,
            .add-saldo-form {
                grid-template-columns: 1fr;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
                gap: 1rem;
            }

            .page-header {
                padding: 1.5rem;
                flex-direction: column;
                text-align: center;
                gap: 1rem;
            }

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

            .admin-input {
                width: 100% !important;
            }

            .add-saldo-form input,
            .add-saldo-form select {
                width: 100%;
            }

            /* Responsive Tables (Card View) */
            .responsive-table thead {
                display: none;
            }

            .responsive-table tr {
                display: block;
                background: #FFFFFF;
                border: 1px solid var(--slate-200);
                padding: 1rem;
                border-radius: 12px;
                margin-bottom: 1rem;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
            }

            .responsive-table td {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.5rem 0;
                text-align: right;
                border-bottom: 1px solid var(--slate-100);
            }

            .responsive-table td:last-child {
                border-bottom: none;
                padding-bottom: 0;
                margin-bottom: 0;
            }

            .responsive-table td::before {
                content: attr(data-label);
                font-weight: 700;
                color: var(--slate-600);
                font-size: 0.75rem;
                text-transform: uppercase;
                text-align: left;
            }

            .responsive-table .empty-state tr {
                border: none;
                background: transparent;
                box-shadow: none;
            }

            /* Ajustes Finos de Proporção Pisom Mobile */
            .sheet-header-card {
                flex-direction: column;
                border-width: 1px;
            }

            .sheet-logo-brand {
                min-width: 100%;
                border-right: 0;
                border-bottom: 1px solid #e2e8f0;
                padding: 1.25rem;
            }

            .sheet-header-metrics {
                grid-template-columns: 1fr;
            }

            .metric-box {
                padding: 0.6rem 1rem;
                border-right: 0;
            }

            .metric-value {
                font-size: 0.85rem;
            }

            .metric-highlight {
                font-size: 1rem;
            }

            .sheet-table td {
                padding: 0.5rem 0.75rem;
                font-size: 0.75rem;
            }

            .sheet-table thead th {
                padding: 0.75rem 0.5rem !important;
                font-size: 0.65rem;
            }
        }

        /* ─── Premium Mobile-First UI ─── */
        .premium-hero {
            background: linear-gradient(135deg, #047857 0%, #059669 100%);
            border-radius: 20px;
            padding: 3.5rem 4rem;
            position: relative;
            overflow: hidden;
            color: white;
            margin-bottom: 2.5rem;
            box-shadow: 0 25px 50px -12px rgba(5, 150, 105, 0.4);
            margin-top: 1rem;
        }

        .premium-hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            blur: 60px;
            pointer-events: none;
        }

        .hero-label {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            opacity: 0.7;
            margin-bottom: 0.5rem;
        }

        .hero-amount {
            font-size: 2.5rem;
            font-weight: 800;
            letter-spacing: -0.02em;
            margin-bottom: 1.5rem;
        }

        .hero-amount span {
            font-size: 1.25rem;
            opacity: 0.6;
            margin-right: 4px;
            font-weight: 600;
        }

        .hero-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 1.5rem;
        }

        .hero-item-label {
            font-size: 0.65rem;
            font-weight: 600;
            opacity: 0.6;
            text-transform: uppercase;
            margin-bottom: 0.25rem;
        }

        .hero-item-value {
            font-size: 0.9rem;
            font-weight: 700;
        }

        /* Monthly Performance Cards (Mobile) */
        .performance-feed {
            display: none;
            flex-direction: column;
            gap: 1rem;
        }

        .performance-card {
            background: #FFFFFF;
            border-radius: 10px;
            padding: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 2px solid transparent;
            transition: all 0.2s;
        }

        /* Destaque Mês Atual */
        .performance-card.current {
            border-color: #d4af37 !important;
            background: #fffbeb !important;
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15) !important;
        }

        .performance-card.current .perf-month {
            color: #92400e !important;
        }

        .performance-card:active {
            transform: scale(0.98);
        }

        .perf-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .perf-icon {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
        }

        .perf-month {
            font-weight: 700;
            color: #1e293b;
            font-size: 0.95rem;
        }

        .perf-meta {
            font-size: 0.7rem;
            color: var(--slate-600);
            margin-top: 2px;
        }

        .perf-value {
            text-align: right;
        }

        .perf-profit {
            color: var(--accent);
            font-weight: 800;
            font-size: 0.95rem;
        }

        .perf-total {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 2px;
            font-weight: 500;
        }

        @media (max-width: 768px) {
            .sheet-table {
                display: none;
            }

            .performance-feed {
                display: flex;
            }

            .hero-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem 0.75rem;
            }

            .hero-amount {
                font-size: 2rem;
                margin-bottom: 2rem;
            }

            .premium-hero {
                padding: 1.5rem 1rem;
                border-radius: 10px;
                margin-top: 0.5rem;
                max-width: 100%;
                width: 100%;
                margin-left: 0;
                margin-right: 0;
            }

            .hero-item-value {
                font-size: 0.8rem;
            }

            .hero-item-label {
                font-size: 0.55rem;
                letter-spacing: 0.02em;
            }

            /* Ajustes nos cards de performance para evitar quebra de linha */
            .performance-card {
                padding: 1rem 0.75rem;
            }

            .perf-icon {
                width: 36px;
                height: 36px;
                font-size: 0.9rem;
            }

            .perf-month {
                font-size: 0.82rem;
            }

            .perf-profit {
                font-size: 0.82rem;
            }

            .perf-total {
                font-size: 0.68rem;
            }
        }

        /* ─── Export Button Style ─── */
        .export-section {
            margin-top: 3rem;
            text-align: center;
            padding: 2rem;
            background: white;
            border-radius: 10px;
            border: 1px dashed var(--slate-200);
        }

        .btn-export {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            background: var(--slate-900);
            color: white;
            padding: 1rem 2rem;
            border-radius: 10px;
            text-decoration: none;
            font-weight: 700;
            transition: all 0.3s;
        }

        .btn-export:hover {
            background: #000;
            transform: translateY(-2px);
        }

        /* Ajustes do Modal de Extrato no Mobile */
        @media (max-width: 768px) {
            #modal-extrato > div {
                max-height: 98vh !important;
                width: 95% !important;
                padding: 0 !important;
            }

            #modal-extrato .modal-header {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container form {
                gap: 0.5rem !important;
            }

            /* Estabilização do Painel Administrativo */
            .card-header {
                padding: 1rem !important;
            }

            .card-header > div:last-child {
                min-width: 100% !important; /* Evita quebra de layout no mobile */
                gap: 0.75rem !important;
            }

            /* Garante que nada transborde lateralmente */
            .main, .layout, body {
                overflow-x: hidden !important;
                max-width: 100vw;
            }

            #modal-extrato .modal-table-container {
                max-height: none !important;
                flex: 1;
                overflow-y: auto;
                min-height: 250px !important;
                border-top: 1px solid #eee;
            }

            #modal-extrato .sheet-table {
                display: table !important; /* Sobrescreve o display:none global */
                font-size: 0.7rem !important;
            }

            #modal-extrato .sheet-table th,
            #modal-extrato .sheet-table td {
                padding: 0.5rem 0.25rem !important;
            }

            #modal-extrato .sheet-table input,
            #modal-extrato .sheet-table select {
                padding: 0.25rem !important;
                font-size: 0.7rem !important;
                width: auto !important;
                max-width: 80px;
            }

            /* Ajustes nos controles do painel no Mobile */
            #sort-investor {
                width: 100% !important;
                order: 2;
            }
            #search-investor {
                width: 100% !important;
                order: 1;
            }
            .card-header button {
                width: 100% !important;
                order: 3;
            }
        }

        @media print {

            .sidebar,
            .mobile-header,
            .bottom-nav,
            .btn-export,
            #investChart,
            .card-header .badge {
                display: none !important;
            }

            .main {
                margin-left: 0 !important;
                padding: 0 !important;
            }

            .premium-hero {
                background: white !important;
                color: black !important;
                border: 2px solid black;
                box-shadow: none;
            }

            .hero-amount,
            .hero-item-value,
            .perf-profit {
                color: black !important;
            }

            .sheet-table {
                display: table !important;
                width: 100% !important;
                border: 1px solid #ddd !important;
            }

            .performance-feed {
                display: none !important;
            }
        }

        /* ─── Spreadsheet Styles (Desktop only refined) ─── */
        @media (min-width: 769px) {
            .sheet-table {
                width: 100%;
                border-collapse: separate;
                border-spacing: 0;
                background: white;
                border-radius: 2px;
                overflow: hidden;
                box-shadow: var(--shadow-premium);
                border: 1px solid rgba(255,255,255,0.08);
            }

            .sheet-table thead th {
                background: #f8fafc;
                color: var(--slate-600);
                text-transform: uppercase;
                font-size: 0.7rem;
                font-weight: 700;
                padding: 1.25rem 1rem;
                border-bottom: 2px solid var(--slate-100);
                text-align: left;
            }

            .sheet-table td {
                padding: 1rem;
                border-bottom: 1px solid var(--slate-50);
                color: var(--slate-800);
            }

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

            .sheet-table tr:hover td {
                background: #fdfdfd;
            }

            .total-row {
                background: #f8fafc;
                font-weight: 800;
            }
        }

        /* ─── Tablet ─── */
        @media (min-width: 769px) and (max-width: 1200px) {
            .sidebar {
                width: 110px;
                padding: 0.5rem 0.25rem;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .sidebar-bottom {
                padding: 0.5rem 0.25rem 1rem;
            }

            .sidebar-logo>div:not(.sidebar-logo-icon),
            .nav-label {
                display: none;
            }

            .sidebar-user-name,
            .sidebar-user-role {
                display: block;
                font-size: 0.6rem;
                text-align: center;
                margin-top: 2px;
            }

            .sidebar-logo {
                justify-content: center;
                padding: 1rem 0.25rem;
                min-height: auto;
                margin-bottom: 1rem;
                border-bottom: 1px solid var(--slate-100);
            }

            .sidebar-logo img {
                max-width: 80px;
                height: auto;
            }

            .nav-item {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                padding: 0.5rem 0.25rem;
                font-size: 0.65rem;
                text-align: center;
                gap: 0.25rem;
                border-radius: 8px;
            }

            .nav-item .icon {
                font-size: 1.4rem;
                width: auto;
                margin: 0;
            }

            .main {
                margin-left: 110px;
                padding: 3rem 2rem;
            }

            /* Investimento ocupa toda a largura no tablet */
            #panel-investimentos .premium-hero,
            #panel-investimentos .card {
                width: 100% !important;
                max-width: none !important;
                margin-left: 0 !important;
                margin-right: 0 !important;
            }

            .sidebar-user {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                text-align: center;
            }

            .logout-link {
                justify-content: center;
                align-items: center;
                flex-direction: column;
                font-size: 0.7rem;
                gap: 4px;
                margin-top: 0.5rem !important;
            }

            .logout-link::before {
                display: none;
            }

            /* Ajustes do painel administrativo no tablet */
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.5rem;
            }

            .add-saldo-form {
                grid-template-columns: 1fr 1fr;
                gap: 1.5rem;
            }

            .add-saldo-form div:nth-child(3) {
                grid-column: span 2;
            }

            /* Descrição ocupa linha toda */
            .add-saldo-form div:last-child {
                grid-column: span 2;
                text-align: right;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .admin-input {
                width: 100% !important;
            }

            .card {
                padding: 1.25rem 0.75rem !important;
                /* Reduz a distância entre a tabela e a borda do card */
            }

            .table-wrapper {
                margin: 0 -0.60rem;
                padding: 0;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .sheet-table th,
            .sheet-table td {
                font-size: 0.75rem !important;
                /* Tamanho reduzido para caber no tablet */
            }
        }
    

/* DASHBOARD STYLES */

        @keyframes pulse {
            0% {
                transform: scale(1);
                opacity: 1;
            }

            50% {
                transform: scale(1.1);
                opacity: 0.8;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        :root {
            --primary: #064e3b;
            --primary-light: #10b981;
            --accent: #10b981;
            --accent-soft: rgba(16, 185, 129, 0.1);
            --danger: #ef4444;
            --warning: #f59e0b;
            --slate-50: #f8fafc;
            --slate-100: #f1f5f9;
            --slate-200: #e2e8f0;
            --slate-400: #94a3b8;
            --slate-600: #475569;
            --slate-800: #f8fafc;
            /* Um branco levemente acinzentado para não cansar a vista */
            /* #1e293b */
            --slate-900: #091635;
            /* #0f172a #091635ff #a3a6adff*/
            --glass: rgba(255, 255, 255, 0.8);
            --glass-border: rgba(255, 255, 255, 0.5);
            --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        /* Grid de Perfil Responsiva */
        .perfil-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            max-width: 1000px;
            gap: 1.5rem;
        }

        @media (max-width: 768px) {
            .perfil-grid {
                grid-template-columns: 1fr;
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate-fade-in {
            animation: fadeInUp 0.6s ease-out both;
        }

        .delay-1 {
            animation-delay: 0.1s;
        }

        .delay-2 {
            animation-delay: 0.2s;
        }

        .delay-3 {
            animation-delay: 0.3s;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background: var(--slate-900);
            min-height: 100vh;
            min-height: 100dvh;
            overflow-x: hidden;
            overflow-y: auto;
            color: #1e293b;
        }

        body::before {
            display: none;
        }

        /* ─── Sidebar ─── */
        .layout {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: 260px;
            background: #E4E4E8;
            padding: 0;
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 100;
            border-right: 1px solid #e2e8f0;
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
        }

        .sidebar-logo {
            background: #E4E4E8;
            display: flex;
            align-items: stretch;
            justify-content: center;
            padding: 0;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            overflow: hidden;
        }

        .sidebar-logo img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: cover;
        }

        .sidebar-logo-icon {
            width: 42px;
            height: 42px;
            background: linear-gradient(135deg, #10b981, #059669);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
        }

        .sidebar-logo-text {
            color: #1e293b;
            font-weight: 700;
            font-size: 1rem;
        }

        .sidebar-logo-text span {
            color: #059669;
        }

        .nav-section {
            margin-bottom: 1.5rem;
        }

        .nav-label {
            color: #94a3b8;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            margin-bottom: 0.5rem;
            padding: 0 0.75rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.72rem 0.85rem;
            margin-bottom: 0.15rem;
            border-radius: 8px;
            color: #475569;
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.18s ease;
            cursor: pointer;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }

        .nav-item:hover {
            background: #f1f5f9;
            color: #1e293b;
        }

        .nav-item.active {
            background: rgba(5, 150, 105, 0.1);
            color: #059669;
            font-weight: 600;
        }

        .nav-item .icon {
            font-size: 1.1rem;
            width: 20px;
            text-align: center;
        }

        .sidebar-bottom {
            margin-top: auto;
            padding: 1.5rem 1.25rem 2rem;
            border-top: 1px solid #e2e8f0;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, #059669, #047857);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
            font-size: 0.875rem;
        }

        .sidebar-user {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .sidebar-user-name {
            color: #1e293b;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .sidebar-user-role {
            color: #94a3b8;
            font-size: 0.75rem;
        }

        /* ─── Main Content ─── */
        .main {
            margin-left: 260px;
            padding: 2.5rem;
            background: #0f172a;
            min-height: 100vh;
        }

        /* ─── Tab Navigation ─── */
        .tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--slate-200);
        }

        .tab-btn {
            padding: 0.75rem 1.5rem;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 600;
            color: #64748b;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
            border-radius: 8px 8px 0 0;
        }

        .tab-btn.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }

        .tab-btn:hover {
            background: rgba(255, 255, 255, 0.05);
            color: white;
        }

        .tab-panel {
            display: none;
        }

        .tab-panel.active {
            display: block;
        }

        /* ─── Header ─── */
        .page-header {
            background: linear-gradient(135deg, #0f2318 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem 2.5rem;
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .page-header h1 {
            color: white;
            font-size: 1.5rem;
            font-weight: 800;
        }

        .page-header p {
            color: #94a3b8;
            font-size: 0.875rem;
            margin-top: 0.25rem;
        }

        .header-badge {
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.3);
            color: #10b981;
            padding: 0.5rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* ─── Cards ─── */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: #FFFFFF;
            padding: 1.5rem;
            border-radius: 10px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            border: 1px solid var(--slate-200);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
        }

        .stat-card-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            margin-bottom: 1rem;
        }

        .stat-card h3 {
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .stat-card .value {
            font-size: 1.5rem;
            font-weight: 800;
            color: #1e293b;
        }

        .stat-card .sub {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 0.25rem;
        }

        /* ─── Cards de seção ─── */
        .card {
            background: #FFFFFF;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 1px solid var(--slate-200);
            margin-bottom: 2rem;
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--slate-100);
        }

        .card-header h2 {
            font-size: 1rem;
            font-weight: 700;
            color: #1e293b;
        }

        .card-badge {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
        }

        /* ─── Tabelas ─── */
        .table-wrapper {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            text-align: left;
            padding: 0.5rem 0.4rem;
            color: var(--slate-600);
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--slate-50);
            border-bottom: 1px solid var(--slate-200);
        }

        th:first-child {
            border-radius: 2px 0 0 2px;
        }

        th:last-child {
            border-radius: 0 2px 2px 0;
        }

        td {
            padding: 0.6rem 0.4rem;
            color: var(--slate-600);
            border-bottom: 1px solid var(--slate-200);
            font-size: 0.875rem;
            transition: background 0.2s;
        }

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

        tr:hover td {
            background: var(--slate-50);
        }

        /* ─── Badges ─── */
        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-pending {
            background: var(--gold-light);
            color: #92400e;
        }

        .badge-success {
            background: var(--green-light);
            color: var(--green-dark);
        }

        .badge-info {
            background: #d1fae5;
            color: #065f46;
        }

        .badge-admin {
            background: #d1fae5;
            color: #064e3b;
        }

        /* ─── Alertas ─── */
        .alert {
            padding: 1rem 1.25rem;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .alert-success {
            background: #FFFFFF;
            color: var(--green-dark);
            border-left: 4px solid var(--green);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        .alert-error {
            background: #FFFFFF;
            color: #991b1b;
            border-left: 4px solid var(--red);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }

        /* ─── Admin Panel ─── */
        .admin-panel {
            background: linear-gradient(135deg, #0a1a0e 0%, #1a3326 100%);
            border-radius: 10px;
            padding: 2rem;
            margin-bottom: 2rem;
        }

        .admin-panel-title {
            color: white;
            font-size: 1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .admin-controls {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
            align-items: flex-end;
        }

        .admin-field label {
            display: block;
            margin-bottom: 0.5rem;
            font-size: 0.8rem;
            color: #94a3b8;
            font-weight: 500;
        }

        .admin-input {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            width: 160px;
            outline: none;
            transition: all 0.2s;
        }

        .admin-input:focus {
            border-color: #10b981;
            background: rgba(255, 255, 255, 0.12);
        }

        .admin-btn {
            padding: 0.625rem 1.5rem;
            border-radius: 2px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
        }

        .admin-btn-green {
            background: #10b981;
            color: white;
        }

        .admin-btn-green:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        .admin-btn-blue {
            background: #10b981;
            color: white;
        }

        .admin-btn-blue:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        /* ─── Switch ─── */
        .switch {
            position: relative;
            display: inline-block;
            width: 52px;
            height: 28px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #475569;
            transition: .3s;
            border-radius: 28px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 4px;
            bottom: 4px;
            background: white;
            transition: .3s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background: #10b981;
        }

        input:checked+.slider:before {
            transform: translateX(24px);
        }

        /* ─── Invest Form ─── */
        .invest-form {
            display: grid;
            grid-template-columns: 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        /* ─── Chart ─── */
        .chart-container {
            position: relative;
            height: 400px;
        }

        /* ─── Investimento Tab: Mesma largura do Extrato ─── */
        #panel-investimentos .premium-hero,
        #panel-investimentos .card {
            width: 100%;
            max-width: none !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            box-sizing: border-box;
        }

        /* ─── Movimentar Buttons ─── */
        .mover-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            max-width: 480px;
            margin: 2rem auto;
        }

        .mover-btn {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-radius: 14px;
            text-decoration: none;
            font-weight: 700;
            font-size: 1rem;
            transition: all 0.25s;
            color: white;
        }

        .mover-btn:hover {
            transform: translateY(-3px);
            filter: brightness(1.1);
        }

        .mover-btn:active { transform: scale(0.97); }

        .mover-btn .mover-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            flex-shrink: 0;
        }

        .mover-btn-aporte  { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 8px 20px -4px rgba(16,185,129,0.4); }
        .mover-btn-retirar { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 8px 20px -4px rgba(239,68,68,0.4); }
        .mover-btn-chat    { background: linear-gradient(135deg, #25d366, #20b958); box-shadow: 0 8px 20px -4px rgba(37,211,102,0.4); }

        /* ─── Info pill ─── */
        .rate-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border: 1px solid #6ee7b7;
            color: #065f46;
            padding: 0.4rem 1rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 700;
        }

        /* ─── Add Saldo Form (admin) ─── */
        .add-saldo-form {
            display: grid;
            grid-template-columns: 1fr 1fr 2fr auto;
            gap: 1rem;
            align-items: end;
        }

        .add-saldo-form input,
        .add-saldo-form select {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: white;
            padding: 0.625rem 1rem;
            border-radius: 2px;
            font-size: 0.875rem;
            outline: none;
        }

        .add-saldo-form input::placeholder {
            color: #64748b;
        }

        .add-saldo-form select option {
            background: #1e293b;
            color: white;
        }

        /* ─── Logout ─── */
        .logout-link {
            color: #ef4444;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logout-link:hover {
            opacity: 0.8;
        }

        /* ─── Empty State ─── */
        .empty-state {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--slate-600);
        }

        .empty-state .empty-icon {
            font-size: 2.5rem;
            margin-bottom: 0.75rem;
        }

        .empty-state p {
            font-size: 0.875rem;
        }

        /* ─── Mobile Elements ─── */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: #E4E4E8;
            padding: 0 1.25rem;
            align-items: center;
            justify-content: space-between;
            z-index: 101;
            border-bottom: 1px solid var(--slate-200);
        }

        .bottom-nav {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 90px; /* Aumentado de 80px */
            background: #FFFFFF;
            border-top: 1px solid var(--slate-200);
            display: none;
            grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); /* Garante divisão igual */
            align-items: center;
            padding-bottom: env(safe-area-inset-bottom);
            z-index: 101;
            box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        }

        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            color: var(--slate-600);
            text-decoration: none;
            font-size: 0.7rem;
            font-weight: 500;
            background: none;
            border: none;
            cursor: pointer;
            transition: all 0.2s;
            padding: 0.5rem 0; /* Aumentado para melhor toque */
        }

        .bottom-nav-item .icon {
            font-size: 1.6rem; /* Reduzido de 2.2rem para melhor equilíbrio */
            line-height: 1;
        }

        .bottom-nav-item.active {
            color: #10b981;
        }

        /* ─── Responsive ─── */
        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            .mobile-header {
                display: flex;
            }

            .bottom-nav {
                display: grid;
            }

            .main {
                margin-left: 0;
                padding: 5.5rem 0.75rem 9rem;
                width: 100%;
                overflow-x: hidden;
            }

            .invest-form,
            .add-saldo-form {
                grid-template-columns: 1fr;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
                gap: 1rem;
            }

            .page-header {
                padding: 1.5rem;
                flex-direction: column;
                text-align: center;
                gap: 1rem;
            }

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

            .admin-input {
                width: 100% !important;
            }

            .add-saldo-form input,
            .add-saldo-form select {
                width: 100%;
            }

            /* Responsive Tables (Card View) */
            .responsive-table thead {
                display: none;
            }

            .responsive-table tr {
                display: block;
                background: #FFFFFF;
                border: 1px solid var(--slate-200);
                padding: 1rem;
                border-radius: 12px;
                margin-bottom: 1rem;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
            }

            .responsive-table td {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.5rem 0;
                text-align: right;
                border-bottom: 1px solid var(--slate-100);
            }

            .responsive-table td:last-child {
                border-bottom: none;
                padding-bottom: 0;
                margin-bottom: 0;
            }

            .responsive-table td::before {
                content: attr(data-label);
                font-weight: 700;
                color: var(--slate-600);
                font-size: 0.75rem;
                text-transform: uppercase;
                text-align: left;
            }

            .responsive-table .empty-state tr {
                border: none;
                background: transparent;
                box-shadow: none;
            }

            /* Ajustes Finos de Proporção Pisom Mobile */
            .sheet-header-card {
                flex-direction: column;
                border-width: 1px;
            }

            .sheet-logo-brand {
                min-width: 100%;
                border-right: 0;
                border-bottom: 1px solid #e2e8f0;
                padding: 1.25rem;
            }

            .sheet-header-metrics {
                grid-template-columns: 1fr;
            }

            .metric-box {
                padding: 0.6rem 1rem;
                border-right: 0;
            }

            .metric-value {
                font-size: 0.85rem;
            }

            .metric-highlight {
                font-size: 1rem;
            }

            .sheet-table td {
                padding: 0.5rem 0.75rem;
                font-size: 0.75rem;
            }

            .sheet-table thead th {
                padding: 0.75rem 0.5rem !important;
                font-size: 0.65rem;
            }
        }

        /* ─── Premium Mobile-First UI ─── */
        .premium-hero {
            background: linear-gradient(135deg, #047857 0%, #059669 100%);
            border-radius: 20px;
            padding: 3.5rem 4rem;
            position: relative;
            overflow: hidden;
            color: white;
            margin-bottom: 2.5rem;
            box-shadow: 0 25px 50px -12px rgba(5, 150, 105, 0.4);
            margin-top: 1rem;
        }

        .premium-hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            blur: 60px;
            pointer-events: none;
        }

        .hero-label {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            opacity: 0.7;
            margin-bottom: 0.5rem;
        }

        .hero-amount {
            font-size: 2.5rem;
            font-weight: 800;
            letter-spacing: -0.02em;
            margin-bottom: 1.5rem;
        }

        .hero-amount span {
            font-size: 1.25rem;
            opacity: 0.6;
            margin-right: 4px;
            font-weight: 600;
        }

        .hero-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 1.5rem;
        }

        .hero-item-label {
            font-size: 0.65rem;
            font-weight: 600;
            opacity: 0.6;
            text-transform: uppercase;
            margin-bottom: 0.25rem;
        }

        .hero-item-value {
            font-size: 0.9rem;
            font-weight: 700;
        }

        /* Monthly Performance Cards (Mobile) */
        .performance-feed {
            display: none;
            flex-direction: column;
            gap: 1rem;
        }

        .performance-card {
            background: #FFFFFF;
            border-radius: 10px;
            padding: 1.25rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
            border: 2px solid transparent;
            transition: all 0.2s;
        }

        /* Destaque Mês Atual */
        .performance-card.current {
            border-color: #d4af37 !important;
            background: #fffbeb !important;
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15) !important;
        }

        .performance-card.current .perf-month {
            color: #92400e !important;
        }

        .performance-card:active {
            transform: scale(0.98);
        }

        .perf-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .perf-icon {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
        }

        .perf-month {
            font-weight: 700;
            color: #1e293b;
            font-size: 0.95rem;
        }

        .perf-meta {
            font-size: 0.7rem;
            color: var(--slate-600);
            margin-top: 2px;
        }

        .perf-value {
            text-align: right;
        }

        .perf-profit {
            color: var(--accent);
            font-weight: 800;
            font-size: 0.95rem;
        }

        .perf-total {
            font-size: 0.75rem;
            color: var(--slate-600);
            margin-top: 2px;
            font-weight: 500;
        }

        @media (max-width: 768px) {
            .sheet-table {
                display: none;
            }

            .performance-feed {
                display: flex;
            }

            .hero-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem 0.75rem;
            }

            .hero-amount {
                font-size: 2rem;
                margin-bottom: 2rem;
            }

            .premium-hero {
                padding: 1.5rem 1rem;
                border-radius: 10px;
                margin-top: 0.5rem;
                max-width: 100%;
                width: 100%;
                margin-left: 0;
                margin-right: 0;
            }

            .hero-item-value {
                font-size: 0.8rem;
            }

            .hero-item-label {
                font-size: 0.55rem;
                letter-spacing: 0.02em;
            }

            /* Ajustes nos cards de performance para evitar quebra de linha */
            .performance-card {
                padding: 1rem 0.75rem;
            }

            .perf-icon {
                width: 36px;
                height: 36px;
                font-size: 0.9rem;
            }

            .perf-month {
                font-size: 0.82rem;
            }

            .perf-profit {
                font-size: 0.82rem;
            }

            .perf-total {
                font-size: 0.68rem;
            }
        }

        /* ─── Export Button Style ─── */
        .export-section {
            margin-top: 3rem;
            text-align: center;
            padding: 2rem;
            background: white;
            border-radius: 10px;
            border: 1px dashed var(--slate-200);
        }

        .btn-export {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            background: var(--slate-900);
            color: white;
            padding: 1rem 2rem;
            border-radius: 10px;
            text-decoration: none;
            font-weight: 700;
            transition: all 0.3s;
        }

        .btn-export:hover {
            background: #000;
            transform: translateY(-2px);
        }

        /* Ajustes do Modal de Extrato no Mobile */
        @media (max-width: 768px) {
            #modal-extrato > div {
                max-height: 98vh !important;
                width: 95% !important;
                padding: 0 !important;
            }

            #modal-extrato .modal-header {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container {
                padding: 1rem !important;
            }

            #modal-extrato .modal-form-container form {
                gap: 0.5rem !important;
            }

            /* Estabilização do Painel Administrativo */
            .card-header {
                padding: 1rem !important;
            }

            .card-header > div:last-child {
                min-width: 100% !important; /* Evita quebra de layout no mobile */
                gap: 0.75rem !important;
            }

            /* Garante que nada transborde lateralmente */
            .main, .layout, body {
                overflow-x: hidden !important;
                max-width: 100vw;
            }

            #modal-extrato .modal-table-container {
                max-height: none !important;
                flex: 1;
                overflow-y: auto;
                min-height: 250px !important;
                border-top: 1px solid #eee;
            }

            #modal-extrato .sheet-table {
                display: table !important; /* Sobrescreve o display:none global */
                font-size: 0.7rem !important;
            }

            #modal-extrato .sheet-table th,
            #modal-extrato .sheet-table td {
                padding: 0.5rem 0.25rem !important;
            }

            #modal-extrato .sheet-table input,
            #modal-extrato .sheet-table select {
                padding: 0.25rem !important;
                font-size: 0.7rem !important;
                width: auto !important;
                max-width: 80px;
            }

            /* Ajustes nos controles do painel no Mobile */
            #sort-investor {
                width: 100% !important;
                order: 2;
            }
            #search-investor {
                width: 100% !important;
                order: 1;
            }
            .card-header button {
                width: 100% !important;
                order: 3;
            }
        }

        @media print {

            .sidebar,
            .mobile-header,
            .bottom-nav,
            .btn-export,
            #investChart,
            .card-header .badge {
                display: none !important;
            }

            .main {
                margin-left: 0 !important;
                padding: 0 !important;
            }

            .premium-hero {
                background: white !important;
                color: black !important;
                border: 2px solid black;
                box-shadow: none;
            }

            .hero-amount,
            .hero-item-value,
            .perf-profit {
                color: black !important;
            }

            .sheet-table {
                display: table !important;
                width: 100% !important;
                border: 1px solid #ddd !important;
            }

            .performance-feed {
                display: none !important;
            }
        }

        /* ─── Spreadsheet Styles (Desktop only refined) ─── */
        @media (min-width: 769px) {
            .sheet-table {
                width: 100%;
                border-collapse: separate;
                border-spacing: 0;
                background: white;
                border-radius: 2px;
                overflow: hidden;
                box-shadow: var(--shadow-premium);
                border: 1px solid rgba(255,255,255,0.08);
            }

            .sheet-table thead th {
                background: #f8fafc;
                color: var(--slate-600);
                text-transform: uppercase;
                font-size: 0.7rem;
                font-weight: 700;
                padding: 1.25rem 1rem;
                border-bottom: 2px solid var(--slate-100);
                text-align: left;
            }

            .sheet-table td {
                padding: 1rem;
                border-bottom: 1px solid var(--slate-50);
                color: var(--slate-800);
            }

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

            .sheet-table tr:hover td {
                background: #fdfdfd;
            }

            .total-row {
                background: #f8fafc;
                font-weight: 800;
            }
        }

        /* ─── Tablet ─── */
        @media (min-width: 769px) and (max-width: 1200px) {
            .sidebar {
                width: 110px;
                padding: 0.5rem 0.25rem;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .sidebar-bottom {
                padding: 0.5rem 0.25rem 1rem;
            }

            .sidebar-logo>div:not(.sidebar-logo-icon),
            .nav-label {
                display: none;
            }

            .sidebar-user-name,
            .sidebar-user-role {
                display: block;
                font-size: 0.6rem;
                text-align: center;
                margin-top: 2px;
            }

            .sidebar-logo {
                justify-content: center;
                padding: 1rem 0.25rem;
                min-height: auto;
                margin-bottom: 1rem;
                border-bottom: 1px solid var(--slate-100);
            }

            .sidebar-logo img {
                max-width: 80px;
                height: auto;
            }

            .nav-item {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                padding: 0.5rem 0.25rem;
                font-size: 0.65rem;
                text-align: center;
                gap: 0.25rem;
                border-radius: 8px;
            }

            .nav-item .icon {
                font-size: 1.4rem;
                width: auto;
                margin: 0;
            }

            .main {
                margin-left: 110px;
                padding: 3rem 2rem;
            }

            /* Investimento ocupa toda a largura no tablet */
            #panel-investimentos .premium-hero,
            #panel-investimentos .card {
                width: 100% !important;
                max-width: none !important;
                margin-left: 0 !important;
                margin-right: 0 !important;
            }

            .sidebar-user {
                flex-direction: column;
                justify-content: center;
                align-items: center;
                text-align: center;
            }

            .logout-link {
                justify-content: center;
                align-items: center;
                flex-direction: column;
                font-size: 0.7rem;
                gap: 4px;
                margin-top: 0.5rem !important;
            }

            .logout-link::before {
                display: none;
            }

            /* Ajustes do painel administrativo no tablet */
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.5rem;
            }

            .add-saldo-form {
                grid-template-columns: 1fr 1fr;
                gap: 1.5rem;
            }

            .add-saldo-form div:nth-child(3) {
                grid-column: span 2;
            }

            /* Descrição ocupa linha toda */
            .add-saldo-form div:last-child {
                grid-column: span 2;
                text-align: right;
            }

            .admin-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .admin-input {
                width: 100% !important;
            }

            .card {
                padding: 1.25rem 0.75rem !important;
                /* Reduz a distância entre a tabela e a borda do card */
            }

            .table-wrapper {
                margin: 0 -0.60rem;
                padding: 0;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .sheet-table th,
            .sheet-table td {
                font-size: 0.75rem !important;
                /* Tamanho reduzido para caber no tablet */
            }
        }
    


/* FIX: Ensure body layout spans full width on dashboard pages */
body:has(.layout) {
    display: block !important;
    padding: 0 !important;
}

.layout {
    width: 100% !important;
    min-height: 100vh;
}

.main {
    flex: 1 !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* Container saudável e normal para telas grandes */
.main-container {
    width: 100% !important;
    max-width: 1200px !important;
    box-sizing: border-box !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Container menor para a página de movimentações (metade do normal de 1000px) */
.movimentar-container {
    max-width: 500px !important;
}

/* Custom styles for Admin table columns to avoid squishing on mobile */
@media (min-width: 769px) {
    .td-cliente-admin {
        max-width: 140px !important;
    }
    .td-email-admin {
        max-width: 150px !important;
    }
}

@media (max-width: 768px) {
    .col-val-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        text-align: right !important;
    }
}
/* ─── PISOM CUSTOM ACTIVE NAV ITEM ─── */
.nav-item.active,
.bottom-nav-item.active {
    background: #e6f7f2 !important;
    color: #059669 !important;
    font-weight: 700 !important;
    border-left: none !important;
    border-radius: 6px !important;
}

.nav-item.active svg,
.nav-item.active .icon,
.bottom-nav-item.active svg,
.bottom-nav-item.active .icon {
    color: #059669 !important;
}

/* ─── Dashboard Chart Responsive Text ─── */
.dashboard-chart-title {
    font-size: 1.25rem;
}
.dashboard-chart-subtitle {
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .dashboard-chart-card {
        padding: 1.25rem 1rem !important;
        margin-top: 1.5rem !important;
        border-radius: 12px !important;
    }
    .dashboard-chart-title {
        font-size: 0.95rem !important;
    }
    .dashboard-chart-title svg {
        width: 18px !important;
        height: 18px !important;
    }
    .dashboard-chart-subtitle {
        font-size: 0.72rem !important;
        margin-top: 0.15rem !important;
    }
}

/* ═════════════════════════════════════════════════════════════════════════
   ESTILOS GLOBAIS DE RESPONSIVIDADE PARA DISPOSITIVOS MÓVEIS E COMPACTOS
   ═════════════════════════════════════════════════════════════════════════ */

/* Mobile Header Base */
.mobile-header-brand {
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-header-logo {
    height: 38px;
    max-width: 150px;
    object-fit: contain;
    margin: 0;
    transition: all 0.2s ease;
}

.mobile-header-user {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
}

.mobile-user-badge {
    font-weight: 600;
    color: #334155;
    font-size: 0.88rem;
    text-transform: capitalize;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: -0.01em;
    max-width: 100%;
    white-space: nowrap;
}

.mobile-user-icon {
    color: #94a3b8;
    flex-shrink: 0;
}

.mobile-user-name-text {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* ─── Celulares Padrão (<= 480px) ─── */
@media (max-width: 480px) {
    .mobile-header {
        height: 64px !important;
        padding: 0 1rem !important;
    }

    .mobile-header-logo {
        height: 35px !important;
        max-width: 135px !important;
    }

    .mobile-user-badge {
        font-size: 0.82rem !important;
    }

    .mobile-user-name-text {
        max-width: 105px !important;
    }

    /* Mais espaço útil na tela */
    .main {
        padding: 4.8rem 0.85rem 7.5rem !important;
    }

    /* Cards gerais */
    .card {
        padding: 1.25rem 1rem !important;
        border-radius: 12px !important;
        margin-bottom: 1.25rem !important;
    }

    /* Card de Saldo no Dashboard */
    .hero-amount {
        font-size: 1.75rem !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-amount span {
        font-size: 1.1rem !important;
    }

    .hero-grid {
        gap: 1rem 0.5rem !important;
    }

    .hero-item-label {
        font-size: 0.58rem !important;
    }

    .hero-item-value {
        font-size: 0.8rem !important;
    }

    /* Bottom Nav proporcional (menos invasiva) */
    .bottom-nav {
        height: 74px !important;
    }

    .bottom-nav-item {
        font-size: 0.65rem !important;
        gap: 2px !important;
        padding: 0.35rem 0 !important;
    }

    .bottom-nav-item .icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Histórico de Performance */
    .performance-card {
        padding: 0.8rem 0.75rem !important;
        gap: 0.5rem !important;
    }

    .perf-valor {
        font-size: 0.88rem !important;
    }

    /* Modais */
    .modal-content {
        padding: 1.25rem 1rem !important;
        width: 95% !important;
        max-width: 95% !important;
        border-radius: 12px !important;
    }

    /* Inputs e botões */
    input, select, textarea {
        font-size: 0.875rem !important;
        padding: 0.65rem 0.75rem !important;
    }

    .btn, button:not(.bottom-nav-item):not(.admin-btn-action):not(.admin-rate-btn):not([title="Remover do Sistema"]):not([title="Salvar Taxa"]):not([title="Editar Cadastro"]):not([title="Gerenciar Lançamentos"]):not([title="Gerar PDF"]) {
        font-size: 0.875rem !important;
        padding: 0.65rem 1rem !important;
    }
}

/* ─── Dispositivos Bem Pequenos / Compactos (<= 380px) ─── */
@media (max-width: 380px) {
    /* Diminui suavemente a escala base para tudo que usa rem encolher harmoniosamente */
    html {
        font-size: 14.5px !important;
    }

    .mobile-header {
        height: 58px !important;
        padding: 0 0.7rem !important;
    }

    .mobile-header-logo {
        height: 32px !important;
        max-width: 120px !important;
    }

    .mobile-user-badge {
        font-size: 0.78rem !important;
    }

    .mobile-user-name-text {
        max-width: 85px !important;
    }

    .main {
        padding: 4.4rem 0.65rem 7rem !important;
    }

    .card {
        padding: 1rem 0.75rem !important;
        border-radius: 10px !important;
        margin-bottom: 1rem !important;
    }

    /* Card de Saldo no Dashboard */
    .hero-label {
        font-size: 0.62rem !important;
        letter-spacing: 0.05em !important;
    }

    .hero-amount {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    .hero-amount span {
        font-size: 0.95rem !important;
    }

    .hero-grid {
        gap: 0.75rem 0.35rem !important;
    }

    .hero-item-label {
        font-size: 0.52rem !important;
    }

    .hero-item-value {
        font-size: 0.72rem !important;
    }

    /* Bottom Nav ultra compacta */
    .bottom-nav {
        height: 68px !important;
    }

    .bottom-nav-item {
        font-size: 0.6rem !important;
    }

    .bottom-nav-item .icon svg {
        width: 17px !important;
        height: 17px !important;
    }

    /* Gráfico */
    .chart-container {
        height: 270px !important;
    }

    /* Login & Cadastro */
    .login-container {
        padding: 1.25rem 0.85rem !important;
        width: 94% !important;
    }

    /* Formulários e botões */
    input, select, textarea {
        padding: 0.55rem 0.65rem !important;
        font-size: 0.8rem !important;
    }

    .btn, button:not(.bottom-nav-item):not(.admin-btn-action):not(.admin-rate-btn):not([title="Remover do Sistema"]):not([title="Salvar Taxa"]):not([title="Editar Cadastro"]):not([title="Gerenciar Lançamentos"]):not([title="Gerar PDF"]) {
        padding: 0.55rem 0.85rem !important;
        font-size: 0.8rem !important;
    }
}

/* ─── Telas Ultra Pequenas (<= 330px, telas dobráveis externas) ─── */
@media (max-width: 330px) {
    html {
        font-size: 13.5px !important;
    }

    .mobile-header-logo {
        height: 28px !important;
        max-width: 95px !important;
    }

    .mobile-user-name-text {
        max-width: 70px !important;
        font-size: 0.72rem !important;
    }

    .hero-amount {
        font-size: 1.35rem !important;
    }

    .bottom-nav {
        height: 62px !important;
    }
}




/* ═════════════════════════════════════════════════════════════════════════
   BOTÕES DE AÇÃO E FORMULÁRIO DO PAINEL ADMINISTRATIVO (COMPACTOS E ALINHADOS)
   ═════════════════════════════════════════════════════════════════════════ */

.admin-actions-group {
    display: flex !important;
    gap: 0.25rem !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
}

.admin-btn-action,
button.admin-btn-action,
a.admin-btn-action {
    height: 28px !important;
    padding: 0 0.55rem !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    line-height: 28px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: opacity 0.2s, background 0.2s !important;
}

.admin-btn-edit {
    background: #f59e0b !important;
    color: #ffffff !important;
}
.admin-btn-edit:hover {
    background: #d97706 !important;
}

.admin-btn-extrato {
    background: #1e3a8a !important;
    color: #ffffff !important;
}
.admin-btn-extrato:hover {
    opacity: 0.9 !important;
}

.admin-btn-pdf {
    background: #3b82f6 !important;
    color: #ffffff !important;
}
.admin-btn-pdf:hover {
    background: #2563eb !important;
}

.admin-btn-email {
    background: #8b5cf6 !important;
    color: #ffffff !important;
}

/* Botão de Apagar (Lixeira) - MENOR, discreto e quadrado proporcional */
.admin-btn-delete,
button.admin-btn-delete,
button[title="Remover do Sistema"] {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
    background: #fef2f2 !important;
    border: 1px solid #fca5a5 !important;
    color: #ef4444 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
.admin-btn-delete:hover,
button.admin-btn-delete:hover,
button[title="Remover do Sistema"]:hover {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
}

/* Formulário de Taxa no Admin */
.admin-rate-form {
    display: flex !important;
    gap: 0.25rem !important;
    align-items: center !important;
}

.admin-rate-input {
    width: 65px !important;
    height: 28px !important;
    padding: 0 0.4rem !important;
    font-size: 0.8rem !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    box-sizing: border-box !important;
}

.admin-rate-btn,
button.admin-rate-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 0 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    color: white !important;
    background: #3b82f6 !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Em telas muito pequenas (<= 380px) */
@media (max-width: 380px) {
    .admin-btn-action,
    button.admin-btn-action,
    a.admin-btn-action {
        height: 26px !important;
        padding: 0 0.45rem !important;
        font-size: 0.68rem !important;
    }
    .admin-btn-delete,
    button.admin-btn-delete,
    button[title="Remover do Sistema"] {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
        font-size: 0.68rem !important;
    }
    .admin-rate-input {
        width: 58px !important;
        height: 26px !important;
        font-size: 0.75rem !important;
    }
    .admin-rate-btn,
    button.admin-rate-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }
}

/* ========================================================
   MODO PRIVACIDADE (APENAS VALOR TOTAL)
======================================================== */
.btn-privacy-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

/* Botao ao lado do valor total no card principal */
.btn-privacy-hero {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.btn-privacy-hero:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* Alternancia dos icones de olho */
.icon-privacy-closed {
    display: none !important;
}
.icon-privacy-open {
    display: inline-flex !important;
    align-items: center;
}

html.privacy-active .icon-privacy-open {
    display: none !important;
}
html.privacy-active .icon-privacy-closed {
    display: inline-flex !important;
    align-items: center;
}

/* Transicao suave */
.hero-amount {
    transition: filter 0.2s ease-in-out;
}

/* Desfoque APENAS no valor total */
html.privacy-active .hero-amount {
    filter: blur(15px) !important;
    user-select: none !important;
    cursor: pointer;
}