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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body{
    background:#0f1115;
    color:white;
    display:flex;
    min-height:100vh;
}

/* SIDEBAR */

.sidebar{
    width:250px;
    min-height:100vh;
    background:#151922;
    padding:20px;
    flex-shrink:0;
    transition: width 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    position: relative;
}

body.sidebar-collapsed .sidebar {
    width: 70px;
    padding: 20px 8px;
}

body.sidebar-collapsed .logo h2,
body.sidebar-collapsed .logo p,
body.sidebar-collapsed .menu a span {
    display: none;
}

body.sidebar-collapsed .menu a {
    justify-content: center;
    padding: 12px 0;
    font-size: 0;
}

body.sidebar-collapsed .menu a i {
    font-size: 18px;
    margin: 0;
}

body.sidebar-collapsed .desktop-toggle-icon {
    transform: rotate(180deg);
}

.logo{
    margin-bottom:30px;
}

.logo h2{
    color:#d4af37;
    word-break: break-word;
}

.menu{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.menu a{
    text-decoration:none;
    color:white;
    background:#1f2630;
    padding:12px;
    border-radius:10px;
    display:block;
}

.menu .active{
    background:#d4af37;
    color:black;
}

/* MAIN */

.main{
    flex:1;
    padding:25px;
    min-width:0;
    max-width:100%;
}

.topbar{
    margin-bottom:25px;
}

.topbar-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
}

.card{
    background:linear-gradient(145deg, #1b1f27, #16191f);
    padding:20px;
    border-radius:15px;
    border: 1px solid #2b313c;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-link{
    text-decoration: none;
    color: inherit;
    display: block;
    border-radius: 15px;
}

.card-link:hover .card{
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border-color: rgba(212, 175, 55, 0.3);
}

.value{
    margin-top:10px;
    font-size:28px;
    font-weight:bold;
}

/* GRÁFICOS (Chart.js) */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.chart-container {
    background: linear-gradient(145deg, #1b1f27, #16191f);
    border-radius: 18px;
    padding: 22px;
    border: 1px solid #2b313c;
}

.chart-container h2 {
    color: #d4af37;
    font-size: 17px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chart-sublabel {
    color: #888;
    font-size: 12px;
    font-weight: normal;
    background: rgba(212, 175, 55, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* LOGIN / CRIAR USUARIO (caixa central) */

.login-container,
.center-container {
    width:100%;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding: 20px;
}

.login-box,
.center-box {
    background:#151922;
    padding:40px;
    border-radius:20px;
    width:380px;
    max-width: 100%;
    border:1px solid #2b313c;
    display:flex;
    flex-direction:column;
    gap:15px;
}

.login-box h1,
.center-box h1 {
    color:#d4af37;
    text-align:center;
    font-size: 24px;
}

.login-box p,
.center-box p {
    text-align:center;
    color:#999;
    margin-bottom:15px;
    font-size: 14px;
}

.login-box input,
.login-box select,
.login-box textarea,
.center-box input,
.center-box select,
.center-box textarea {
    padding:14px;
    border:none;
    border-radius:10px;
    background:#1f2630;
    color:white;
    width: 100%;
    font-size: 14px;
    font-family: inherit;
}

.login-box button,
.center-box button {
    padding:14px;
    border:none;
    border-radius:10px;
    background:#d4af37;
    color:black;
    font-weight:bold;
    cursor:pointer;
    width: 100%;
    font-size: 15px;
}

.login-box textarea,
.center-box textarea {
    min-height:100px;
    resize:none;
}

.login-box .links,
.center-box .links {
    text-align:center;
    margin-top:10px;
}

.login-box .links a,
.center-box .links a {
    color:#d4af37;
    text-decoration:none;
    font-size:14px;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* FORMULÁRIOS */

.form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

.form-container{
    background:#151922;
    padding:30px;
    border-radius:20px;
    border:1px solid #2b313c;
}

.finance-form{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.form-group label{
    color:#bbb;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select{
    padding:14px;
    border:none;
    border-radius:10px;
    background:#1f2630;
    color:white;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
}

.form-group textarea{
    min-height:120px;
    resize:vertical;
}

.form-hint {
    color: #888;
    font-size: 12px;
    font-style: italic;
    margin-top: -2px;
}

.btn-save{
    background:#d4af37;
    color:black;
    border:none;
    padding:15px;
    border-radius:12px;
    font-weight:bold;
    cursor:pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.alert-success{
    background:#16351f;
    color:#7dff9b;
    padding:15px;
    border-radius:12px;
    margin-bottom:20px;
    border: 1px solid rgba(125, 255, 155, 0.2);
}

.alert-error{
    background:#3a1717;
    color:#ff8b8b;
    padding:15px;
    border-radius:12px;
    border: 1px solid rgba(255, 139, 139, 0.2);
}

/* TABELA DE LANÇAMENTOS E DETALHES */
.recent-transactions {
    margin-top: 30px;
    background: #151922;
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #2b313c;
}

.recent-transactions h2 {
    font-size: 20px;
    color: #d4af37;
    margin-bottom: 20px;
}

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

.finance-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.finance-table th {
    padding: 14px 16px;
    color: #999;
    border-bottom: 2px solid #2b313c;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.finance-table th.th-sortable {
    padding: 0;
}

.finance-table th.th-sortable .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
    width: 100%;
    user-select: none;
}

.finance-table th.th-sortable .sort-link:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.finance-table th.th-sortable .sort-link.sort-active {
    color: #d4af37;
}

.finance-table th.th-sortable .sort-icon {
    font-size: 11px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.finance-table th.th-sortable .sort-link.sort-active .sort-icon {
    opacity: 1;
}

.finance-table th.th-valor .sort-link {
    justify-content: flex-end;
}

.finance-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #1f2630;
    font-size: 15px;
    color: #ddd;
    vertical-align: middle;
}

.finance-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.badge-entrada {
    background: rgba(22, 53, 31, 0.6);
    color: #7dff9b;
    border: 1px solid rgba(125, 255, 155, 0.2);
}

.badge-despesa {
    background: rgba(58, 23, 23, 0.6);
    color: #ff8b8b;
    border: 1px solid rgba(255, 139, 139, 0.2);
}

.badge-cargo {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-edit {
    background: rgba(125, 255, 155, 0.1);
    color: #7dff9b;
    border-color: rgba(125, 255, 155, 0.15);
    margin-right: 8px;
}

.btn-edit:hover {
    background: #7dff9b;
    color: #0f1115;
    border-color: #7dff9b;
}

.btn-back-mobile {
    background: #1f2630;
    border: 1px solid #2b313c;
    color: #d4af37;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-back-mobile:hover {
    background: #d4af37;
    color: #000;
}

/* Detalhes visuais das células da tabela de lançamentos */
.td-categoria {
    font-weight: 500;
    color: #fff;
}

.td-nome {
    font-weight: 600;
    color: #e6c14d;
    max-width: 220px;
    word-break: break-word;
}
.td-subsep {
    color: #666;
    font-size: 13px;
}
.td-subcat {
    color: #aaa;
    font-size: 13px;
    font-weight: normal;
}
.td-icon-user {
    font-size: 11px;
    color: #d4af37;
    margin-right: 4px;
}
.td-dash {
    color: #555;
}
.td-pagamento {
    font-size: 13px;
    font-weight: bold;
    color: #999;
}
.td-descricao {
    font-size: 14px;
}
.td-valor {
    font-weight: bold;
    font-size: 16px;
}
.td-valor-entrada {
    color: #7dff9b;
}
.td-valor-despesa {
    color: #ff8b8b;
}

.btn-delete-item {
    color: #ff8b8b;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 139, 139, 0.1);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 139, 139, 0.15);
    white-space: nowrap;
}

.btn-delete-item:hover {
    background: #ff8b8b;
    color: #0f1115;
    border-color: #ff8b8b;
}

.btn-edit-item {
    color: #d4af37;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.1);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    white-space: nowrap;
    margin-right: 6px;
}

.btn-edit-item:hover {
    background: #d4af37;
    color: #0f1115;
    border-color: #d4af37;
}

.card-sublabel {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(212, 175, 55, 0.12);
    color: #d4af37;
    font-size: 11px;
    font-weight: bold;
    border-radius: 6px;
    vertical-align: middle;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
}

/* PAINEL DE FILTROS AVANÇADOS */
.filters-panel {
    background: #151922;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #2b313c;
    margin-bottom: 25px;
}

.filters-panel h3 {
    color: #d4af37;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.filter-group label {
    font-size: 13px;
    color: #d4af37;
    font-weight: bold;
}

.filter-group select,
.filter-group input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #1f2630;
    color: white;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #2b313c;
    padding-top: 15px;
}

.btn-filter-submit {
    background: #d4af37;
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
    text-decoration: none;
}

.btn-filter-submit:hover {
    opacity: 0.9;
}

.btn-filter-clear {
    background: #1f2630;
    border: 1px solid #2b313c;
    color: #999;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

/* DASHBOARD: BLOCOS DE AÇÃO */
.dashboard-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-actions .actions-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-actions .btn-control {
    background: #1f2630;
    border: 1px solid #2b313c;
    color: #d4af37;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-actions .btn-control.btn-print {
    color: #7dff9b;
}

.dashboard-actions .btn-control.btn-new {
    background: #d4af37;
    color: #000;
    border-color: #d4af37;
}

.dashboard-actions .btn-control.btn-new:hover {
    background: #e6c14d;
    border-color: #e6c14d;
    color: #000;
}

.dashboard-actions .btn-control.active {
    background: #d4af37;
    color: black;
    border-color: #d4af37;
}

.dashboard-actions .btn-control:hover {
    background: #d4af37;
    color: black;
    border-color: #d4af37;
}

.dashboard-actions .btn-clear-filters {
    color: #ff8b8b;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.transactions-header h2 {
    margin: 0;
}

/* MEMBROS: header e busca */
.membros-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-add-membro {
    background: #d4af37;
    color: black;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-add-membro:hover {
    opacity: 0.9;
}

.search-container {
    background: #151922;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #2b313c;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #1f2630;
    color: white;
    font-size: 14px;
    font-family: inherit;
}

.btn-search {
    background: #1f2630;
    border: 1px solid #2b313c;
    color: #d4af37;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-search:hover {
    background: #d4af37;
    color: black;
    border-color: #d4af37;
}

/* CONFIGURAÇÕES (grid de 2 colunas) */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.config-card {
    background: #151922;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #2b313c;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-card h2 {
    font-size: 18px;
    color: #d4af37;
    border-bottom: 1px solid #2b313c;
    padding-bottom: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* BOTÃO HAMBÚRGUER (MOBILE + DESKTOP) */
.mobile-menu-toggle {
    display: inline-flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #151922;
    border: 1px solid #2b313c;
    color: #d4af37;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* HEADER FIXO NO MOBILE */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #151922;
    border-bottom: 1px solid #2b313c;
    z-index: 1090;
    padding: 0 15px 0 68px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    overflow: hidden;
}

.mobile-header-greeting {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
    min-width: 0;
}

.mobile-header-greeting .greeting-hi {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-greeting .greeting-name {
    color: #d4af37;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-org {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.mobile-menu-toggle:hover {
    background: #d4af37;
    color: #000;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

/* Quando a sidebar está colapsada no desktop, o main deve ocupar o espaço liberado */
body.sidebar-collapsed .main {
    flex: 1;
}

/* ============================================ */
/* RESPONSIVIDADE - TABLET E MOBILE             */
/* ============================================ */

@media (max-width: 1024px) {
    .table-responsive {
        overflow-x: auto;
    }
    .finance-table {
        min-width: 700px;
    }
}

@media (max-width: 900px) {
    .config-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

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

@media (max-width: 768px) {

    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    body {
        flex-direction: column;
        max-width: 100vw;
    }

    .main {
        min-width: 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    img, table, pre, code {
        max-width: 100% !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        top: 6px !important;
        left: 12px !important;
    }

    body.sidebar-open .mobile-menu-toggle {
        left: 270px !important;
        background: #d4af37 !important;
        color: #000 !important;
    }

    .mobile-header {
        display: flex !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 260px !important;
        height: 100vh !important;
        min-height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5) !important;
        overflow-y: auto !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .main {
        padding: 70px 15px 20px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .topbar {
        margin-bottom: 18px !important;
    }

    .topbar h1 {
        font-size: 22px !important;
    }

    .topbar p {
        font-size: 13px !important;
    }

    .cards {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .card {
        padding: 16px !important;
    }

    .card h3 {
        font-size: 14px !important;
    }

    .value {
        font-size: 22px !important;
    }

    .recent-transactions {
        padding: 16px !important;
        border-radius: 14px !important;
        margin-top: 20px !important;
    }

    .recent-transactions h2 {
        font-size: 17px !important;
    }

    .form-container {
        padding: 18px !important;
        border-radius: 14px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .membros-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .btn-add-membro {
        align-self: stretch !important;
        justify-content: center !important;
    }

    .search-container {
        flex-direction: column !important;
        padding: 14px !important;
        gap: 10px !important;
    }

    .search-input {
        min-width: 0 !important;
        width: 100% !important;
    }

    .btn-search {
        justify-content: center !important;
        width: 100% !important;
    }

    .dashboard-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .dashboard-actions .actions-group {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100%;
    }

    .dashboard-actions .btn-control {
        width: 100% !important;
        justify-content: center !important;
    }

    .dashboard-actions .btn-clear-filters {
        justify-content: center !important;
    }

    .filters-panel {
        padding: 16px !important;
    }

    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .filters-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .filters-actions button {
        width: 100% !important;
        justify-content: center !important;
    }

    .transactions-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* TABELAS: transformar em cards */
    .table-responsive {
        overflow-x: visible !important;
    }

    .finance-table,
    .finance-table tbody,
    .finance-table tr,
    .finance-table td {
        display: block !important;
        width: 100% !important;
    }

    .finance-table thead {
        display: none !important;
    }

    .finance-table tbody {
        display: block !important;
    }

    .finance-table tr {
        background: #1b1f27 !important;
        border: 1px solid #2b313c !important;
        border-radius: 12px !important;
        margin-bottom: 14px !important;
        padding: 4px 0 !important;
        display: block !important;
    }

    .finance-table td {
        padding: 10px 14px !important;
        border-bottom: 1px solid #1f2630 !important;
        display: grid !important;
        grid-template-columns: minmax(90px, auto) 1fr !important;
        align-items: center !important;
        column-gap: 12px !important;
        font-size: 14px !important;
        width: 100% !important;
        word-break: break-word;
        min-width: 0 !important;
    }

    .finance-table td:last-child {
        border-bottom: none !important;
        grid-template-columns: 1fr !important;
        justify-items: end !important;
    }

    .finance-table td::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #d4af37 !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
    }

    .finance-table td:empty {
        display: none !important;
    }

    /* Força o conteúdo (texto/HTML) a aparecer sempre */
    .finance-table td > * {
        display: inline-block !important;
        max-width: 100% !important;
    }

    /* Botão Voltar do editar-membro */
    .topbar-with-action {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .btn-back-mobile {
        align-self: stretch !important;
        justify-content: center !important;
    }

    /* Login e criar-usuario */
    .login-box,
    .center-box {
        width: 100% !important;
        max-width: 380px !important;
        padding: 28px 22px !important;
    }

    .login-container,
    .center-container {
        padding: 20px !important;
    }
}

@media (max-width: 480px) {

    .main {
        padding: 65px 10px 15px 10px !important;
    }

    .card {
        padding: 14px !important;
    }

    .value {
        font-size: 20px !important;
    }

    .form-container,
    .recent-transactions {
        padding: 14px !important;
    }

    .finance-table td {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    .login-box,
    .center-box {
        padding: 24px 18px !important;
    }

    .filters-panel {
        padding: 14px !important;
    }

    .topbar h1 {
        font-size: 20px !important;
    }
}

/* ESTILOS DE IMPRESSÃO (MEDIA PRINT) PARA RELATÓRIOS */
@media print {
    body {
        background: white !important;
        color: black !important;
        display: block !important;
    }

    .sidebar,
    .topbar,
    #btnToggleFiltros,
    .btn-filter-submit,
    .filters-actions,
    .btn-delete-item,
    .btn-edit-item,
    #painelFiltros,
    .links,
    [onclick="window.print()"],
    a[href*="excluir="],
    a[href*="editar-lancamento.php"],
    .mobile-menu-toggle,
    .sidebar-overlay,
    .dashboard-actions,
    .charts-grid,
    .chart-container {
        display: none !important;
    }

    .main {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .cards {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
        margin-bottom: 40px !important;
    }

    .card {
        background: #f5f5f5 !important;
        color: black !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        padding: 15px !important;
        border-radius: 10px !important;
    }

    .card h3 {
        font-size: 14px !important;
        color: #555 !important;
        margin-bottom: 5px !important;
    }

    .card .value {
        color: black !important;
        font-size: 22px !important;
    }

    .recent-transactions {
        background: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .recent-transactions h2 {
        color: black !important;
        font-size: 22px !important;
        border-bottom: 2px solid black !important;
        padding-bottom: 10px !important;
        margin-bottom: 20px !important;
    }

    .finance-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .finance-table th {
        color: #333 !important;
        border-bottom: 2px solid #333 !important;
        padding: 10px !important;
        font-size: 13px !important;
    }

    .finance-table th.th-sortable {
        padding: 10px !important;
    }

    .finance-table th.th-sortable .sort-link {
        padding: 0 !important;
        color: #333 !important;
        background: none !important;
    }

    .finance-table th.th-sortable .sort-icon {
        display: none !important;
    }

    .finance-table td {
        color: black !important;
        border-bottom: 1px solid #ddd !important;
        padding: 10px !important;
        font-size: 13px !important;
    }

    .badge {
        border: 1px solid #666 !important;
        color: black !important;
        background: transparent !important;
        padding: 2px 6px !important;
        font-size: 11px !important;
    }

    .finance-table th:last-child,
    .finance-table td:last-child {
        display: none !important;
    }
}
