:root {
    --bg-body: #0b1219;
    --bg-sidebar: #131d26;
    --bg-header: #131d26;
    --bg-card: #1b2631;
    --text-primary: #ffffff;
    --text-sec: #9daab6;
    --primary: #f12c4c; /* Vermelho Blaze */
    --primary-hover: #d0203e;
    --border: #26323f;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.logo-area {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 1px;
}

.nav-menu { list-style: none; padding: 20px 0; margin: 0; }

.nav-link {
    display: block;
    padding: 15px 25px;
    color: var(--text-sec);
    border-left: 3px solid transparent;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255,255,255,0.02);
    border-left-color: var(--primary);
}

.nav-link i { margin-right: 10px; width: 20px; text-align: center; }

/* Main */
.main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; }

.header {
    height: 70px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.user-info { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Content */
.content { padding: 30px; }
.page-title { font-size: 24px; margin-bottom: 25px; font-weight: 500; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h3 {
    color: var(--text-sec);
    font-size: 12px;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.card .val { font-size: 28px; font-weight: 500; }

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

/* Forms & Tables */
input, select, textarea {
    background: #0f161e;
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

textarea { min-height: 90px; }

/* Form rows (Nome/Sobrenome, Senha/Confirmar etc.) */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > * { margin-bottom: 0; }

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

button:hover { background: var(--primary-hover); }

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

th {
    text-align: left;
    color: var(--text-sec);
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
}

.badge.pending { background: #b58900; color: black; }
.badge.active,
.badge.approved { background: #00e396; color: black; }
.badge.blocked,
.badge.rejected { background: #ff4d4d; color: white; }
.badge.paid { background: #7c5cff; color: white; }

.small { font-size: 12px; color: var(--text-sec); }
.hr { height: 1px; background: var(--border); margin: 15px 0; }

.btn-secondary { background: #273443; }
.btn-secondary:hover { background: #334457; }

/* Mobile */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .header { padding: 0 16px; }
    .content { padding: 16px; }
}

/* Auth Pages */
.auth-body {
    /* Login/Cadastro: centralizado na tela (mobile e desktop) */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    /* iOS: usa viewport dinâmico para centralizar mesmo com barras do Safari */
    min-height: 100vh;
    min-height: 100dvh;

    /* ✅ COR FIXA (sem degradê/contraste) */
    background: var(--bg-body);

    overflow-x: hidden;
}

/* iPhone/Safari: respeita safe-area no CADASTRO para não parecer desalinhado */
.auth-body.auth-register {
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
}

/* Garante que o box do cadastro nunca "vaze" e fique 100% centralizado */
.auth-body.auth-register .auth-box {
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* Cadastro: trava alinhamento interno (Safari às vezes calcula %/vw diferente) */
.auth-body.auth-register .auth-box,
.auth-body.auth-register .auth-box * {
    box-sizing: border-box;
}

.auth-body.auth-register form { width: 100%; }

.auth-body.auth-register input,
.auth-body.auth-register select,
.auth-body.auth-register textarea {
    width: 100%;
    max-width: 100%;
}

.auth-box {
    width: 100%;
    max-width: 440px;
    background: var(--bg-sidebar);
    padding: 34px 28px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    /* Box maior no celular */
    .auth-box {
        width: 100%;
        max-width: 440px;
        padding: 28px 16px;
    }

    /* Inputs maiores (fica mais "cheio" e sem necessidade de zoom) */
    input, select, textarea {
        padding: 12px 10px;
        font-size: 14px;
        border-radius: 6px;
    }

    button {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 6px;
    }

    .form-row { grid-template-columns: 1fr; }
}