/* =========================================================
   ROOT VARIABLES
========================================================= */
:root {
    --primary: #1e293b;
    --accent: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius: 12px;
}


/* =========================================================
   BASE LAYOUT
========================================================= */
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app {
    display: flex;
    flex: 1;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 20px;
}


/* =========================================================
   SIDEBAR
========================================================= */
.sidebar {
    width: 240px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 5px;
    position: relative;
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .sidebar ul li {
        margin-bottom: 8px;
    }

        .sidebar ul li a {
            display: block;
            padding: 5px 7px;
            border-radius: 8px;
            text-decoration: none;
            color: #94a3b8;
            transition: 0.2s;
        }

            .sidebar ul li a:hover,
            .sidebar ul li a.active {
                background: #1e293b;
                color: #ffffff;
            }


/* =========================================================
   TOPBAR
========================================================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-menu {
    background: var(--accent);
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}


/* =========================================================
   NAV BUTTON (mesmo estilo dos links)
========================================================= */
.btn-nav {
    display: block;
    width: 100%;
    text-align: left;
    padding: 5px 7px;
    border-radius: 8px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-nav:hover,
    .btn-nav.active {
        background: #1e293b;
        color: #ffffff;
    }


/* =========================================================
   USER DROPDOWN
========================================================= */
.user-menu {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
}

.dropdown {
    display: none;
    list-style: none;
    margin: 8px;
    padding: 24px !important;
    background: #0f172a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

    .dropdown li a {
        display: block;
        padding: 5px 7px !important;
        color: #cbd5e1;
        text-decoration: none;
        transition: 0.2s;
        font-size: 12px;
    }

        .dropdown li a:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }


/* =========================================================
   DASHBOARD CARDS
========================================================= */
.cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.card-dashboard {
    flex: 1;
    min-width: 220px;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--accent);
    transition: transform 0.2s;
}

    .card-dashboard:hover {
        transform: translateY(-3px);
    }

    .card-dashboard h5 {
        color: var(--text-muted);
        font-size: 14px;
    }

    .card-dashboard .valor {
        font-size: 22px;
        font-weight: 600;
    }


/* =========================================================
   CHARTS
========================================================= */
.chart-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 100%;
    height: 300px;
}

.chart-medium {
    height: 350px;
}

.chart-small {
    height: 350px;
}


/* =========================================================
   FOOTER
========================================================= */
.footer {
    background: #e2e8f0;
    color: var(--text-main);
    text-align: center;
    padding: 15px;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.05);
}


/* =========================================================
   DARK MODE
========================================================= */
body.dark-mode {
    --bg-main: #1e293b;
    --bg-card: #2d3748;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
}

    body.dark-mode .sidebar {
        background: #0f172a;
    }

    body.dark-mode .topbar {
        background: #1e293b;
        color: #e2e8f0;
    }

    body.dark-mode .card-dashboard {
        background: var(--bg-card);
        color: var(--text-main);
    }

    body.dark-mode .footer {
        background: #1e293b;
        color: #94a3b8;
    }


/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px) {

    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100%;
        transition: 0.3s;
        z-index: 1000;
    }

        .sidebar.active {
            left: 0;
        }

    .cards {
        flex-direction: column;
    }

    .content {
        padding: 20px;
    }

    .footer {
        left: 0;
    }
}
