/* =====================================================
   RESET
===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

/* =====================================================
   LAYOUT BASE
===================================================== */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ================= SIDEBAR ================= */

.sidebar {
    width: 240px;
    background: #111827;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-img {
    width: 38px;
}

.logo-text {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.logo-text span {
    color: #22c55e;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 14px;
}

.menu a:hover {
    background: #1f2937;
    color: #22c55e;
}

.logout-link {
    margin-top: 20px;
    color: #ef4444 !important;
}

/* ================= MAIN ================= */

.main {
    flex: 1;
    padding: 30px;
}

.conteudo-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* =====================================================
   TOPBAR
===================================================== */

.topbar {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.badge-plano {
    background: #2563eb;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* =====================================================
   CARDS
===================================================== */

.card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

/* =====================================================
   FORMULÁRIOS
===================================================== */

input, select, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    margin-bottom: 12px;
}

/* REMOVE ESTILO GLOBAL VERDE */

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* =====================================================
   BOTÕES PADRÃO DO SISTEMA
===================================================== */

.btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
    font-weight: 500;
    transition: 0.2s ease;
}

/* PRINCIPAL */
.btn-primary {
    background: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* EDITAR */
.btn-edit {
    background: #2563eb;
}

.btn-edit:hover {
    background: #1d4ed8;
}

/* EXCLUIR */
.btn-delete {
    background: #dc2626;
}

.btn-delete:hover {
    background: #b91c1c;
}

/* TAMANHO PEQUENO */
.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

.acoes-inline {
    display: flex;
    gap: 8px;
}

/* =====================================================
   TABELAS
===================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th {
    background: #f1f5f9;
    padding: 12px;
    text-align: left;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* =====================================================
   DASHBOARD
===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 25px;
    border-radius: 16px;
    color: white;
}

.stat-card h2 {
    font-size: 26px;
    margin-top: 6px;
}

.stat-card.receita {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.stat-card.despesa {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.stat-card.lucro {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.grafico-container-barra {
    width: 100%;
    height: 420px;
}

/* =====================================================
   PLANOS
===================================================== */

.planos-wrapper {
    max-width: 1100px;
    margin: 40px auto;
    text-align: center;
}

.planos-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.plano-card {
    width: 420px;
    background: white;
    padding: 45px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.08);
    transition: 0.3s;
    position: relative;
}

.plano-card:hover {
    transform: translateY(-10px);
}

.plano-card.premium {
    border: 2px solid #2563eb;
    transform: scale(1.05);
}

.preco {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 25px;
}

.badge {
    position: absolute;
    top: -18px;
    right: 25px;
    background: #2563eb;
    color: white;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 20px;
}

/* =====================================================
   AUTH PAGES
===================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
}

.auth-card {
    background: white;
    width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
}

.auth-logo {
    width: 80px;
    margin-bottom: 15px;
}

/* =====================================================
   BADGES DE PLANO
===================================================== */

.badge-free {
    background:#e5e7eb;
    color:#111;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
}

.badge-premium {
    background:#2563eb;
    color:white;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
}

.badge-admin {
    background:#111827;
    color:white;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
}

/* =====================================================
   RESPONSIVO
===================================================== */

@media (max-width: 900px) {

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main {
        padding: 20px;
    }

    .planos-grid {
        flex-direction: column;
        align-items: center;
    }

    .plano-card.premium {
        transform: scale(1);
    }
}
/* =====================================================
   BOTÕES PADRÃO SISTEMA (VERSÃO COMPATÍVEL)
===================================================== */

/* BOTÃO PADRÃO (verde - formulários) */
button {
    background: #16a34a;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    background: #15803d;
}

/* BOTÃO PRINCIPAL (links estilo botão) */
.btn-primary {
    background: #2563eb;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* EDITAR (AZUL) */
.btn-warning {
    background: #2563eb;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
}

.btn-warning:hover {
    background: #1d4ed8;
}

/* EXCLUIR (VERMELHO) */
.btn-danger {
    background: #dc2626;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* BOTÕES INLINE */
.acoes-inline {
    display: flex;
    gap: 8px;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

/* =====================================================
   FIX DASHBOARD (CARDS TRANSPARENTES)
===================================================== */

/* Corrige cards novos (que não são receita/despesa/lucro) */
.stat-card:not(.receita):not(.despesa):not(.lucro) {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

/* Ajuste de textos dentro dos cards */
.stat-card span {
    font-size: 13px;
    color: inherit;
    opacity: 0.85;
}

.stat-card h2 {
    color: inherit;
}

/* Hover suave padrão SaaS */
.stat-card {
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}
