:root {
    --primary-color: #0057B8;
    --primary-dark: #0A2A43;
    --dark-bg: #081C2C;
    --light-bg: #F3F7FB;
    --card-radius: 18px;
    --nav-height-mobile: 76px;
    --center-btn-size: 64px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: var(--light-bg);
    color: #212529;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    text-decoration: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--card-radius);
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar-desktop {
    width: 270px;
    min-height: 100vh;
    background: var(--dark-bg);
    color: #fff;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d1d5db;
    padding: 12px 14px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-link.active {
    background: var(--primary-color);
    color: #fff;
}

.content-area {
    flex: 1;
    padding: 24px;
    width: 100%;
    min-width: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.page-subtitle {
    color: #6c757d;
    margin: 0;
}

.card-soft {
    border: 0;
    border-radius: var(--card-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    overflow: hidden;
}

.stat-card {
    border: 0;
    border-radius: var(--card-radius);
    background: #fff;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    height: 100%;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--nav-height-mobile);
    background: #ffffff;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    padding: 0 10px calc(env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 12px;
    min-width: 56px;
    background: transparent;
    border: 0;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

.mobile-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 4px;
}

.mobile-nav-center-btn {
    width: var(--center-btn-size);
    height: var(--center-btn-size);
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -28px;
    box-shadow: 0 12px 30px rgba(13, 110, 253, 0.35);
    flex-shrink: 0;
}

.mobile-menu-modal {
    border-radius: 22px 22px 0 0;
    border: 0;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.mobile-menu-card {
    background: #f8f9fa;
    border-radius: 18px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #212529;
    font-weight: 600;
    gap: 10px;
    transition: 0.2s ease;
    padding: 16px;
    text-align: center;
}

.mobile-menu-card:hover {
    background: #e9ecef;
    color: #212529;
}

.mobile-menu-emoji {
    font-size: 28px;
}

.table thead th {
    white-space: nowrap;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 110px;
    }

    .app-wrapper {
        display: block;
        min-height: auto;
    }

    .content-area {
        padding: 16px 14px 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .page-title {
        font-size: 22px;
    }

    .card-soft {
        border-radius: 20px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }
}

.chart-box {
    position: relative;
    width: 100%;
    height: 320px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

@media (max-width: 767.98px) {
    .chart-box {
        height: 260px;
    }
}

.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.table-responsive table {
    min-width: 900px;
}

.td-observacao {
    min-width: 260px;
    white-space: normal;
    word-break: break-word;
}

.td-data {
    white-space: nowrap;
}

.td-tipo,
.td-id,
.td-qtd,
.td-valor {
    white-space: nowrap;
}