/* ==========================
   RESET E VARIÁVEIS GLOBAIS
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
:root {
    --primary-color: #001691;
    --primary-dark: #1565c0;
    --primary-light: #42a5f5;
    --secondary-color: #ff9800;
    --secondary-dark: #f57c00;
    --secondary-light: #ffb74d;
    --accent-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --success-color: #4caf50;
    --background-primary: #fafafa;
    --background-secondary: #ffffff;
    --background-dark: #f5f5f5;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-disabled: #bdbdbd;
    --text-white: #ffffff;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    --transition-fast: 0.2s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    --navbar-height: 64px;
    --sidebar-width: 280px;
    --border-radius: 8px;
    --border-radius-large: 16px;
}
/* ==========================
   ESTILO BASE DO BODY
========================== */
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--background-primary);
    background-image: url('../img/JuninoproFundoOF.png');
    background-position: center;
    background-size: cover;
    background-repeat: repeat;
}
/* ==========================
   NAVBAR
========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: #3c59f8;
    box-shadow: var(--shadow-2);
    z-index: 1000;
}
.navbar-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo {
    height: 40px;
    width: auto;
}
.logo-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-white);
}
/* ==========================
   SIDEBAR
========================== */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background-color: var(--background-secondary);
    box-shadow: var(--shadow-2);
    z-index: 999;
    overflow-y: auto;
    transition: transform var(--transition-normal);
}
.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--background-dark);
}
.sidebar-header h3 {
    font-size: 18px;
    font-weight: 500;
}
.sidebar-menu {
    list-style: none;
    padding: 0;
}
.sidebar-item {
    margin: 4px 16px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}
.sidebar-link:hover {
    background-color: var(--background-dark);
    color: var(--text-primary);
}
.sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* Logo JuninoPró no rodapé da sidebar */
.sidebar-footer {
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--background-dark);
    margin-top: auto; /* empurra pro fim da sidebar */
}

.sidebar-footer .logo-footer {
    width: 145px;       /* largura da imagem */
    max-width: 100%;
    height: auto;       /* mantém proporção */
    display: inline-block;
    opacity: 0.8;       /* ligeiramente suavizada */
    transition: opacity var(--transition-fast);
}

.sidebar-footer .logo-footer:hover {
    opacity: 1;
}





/* ==========================
   MAIN CONTENT
========================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
}
.content-wrapper {
    position: relative;
    min-height: 100%;
    background: transparent;
}
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(118, 75, 162, 0.8));
    opacity: 0.6;
    z-index: 1;
}
/* ==========================
   DASHBOARD HEADER
========================== */
.dashboard-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-white);
}
.dashboard-header h1 {
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.dashboard-header p {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.9;
}
/* ==========================
   DASHBOARD GRID
========================== */
.dashboard-grid {
    position: relative;
    z-index: 2;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;

}

/* ==========================
   CARDS UNIFICADOS
========================== */
.card-unificado {
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-large);
    padding: 32px;
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeInUp 0.6s ease-out;

    overflow-y: auto;

}
.card-unificado:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-3);
}
.card-unificado .material-icons {
    font-size: 32px;
    color: var(--primary-color);
}
.card-unificado .stat-icon .material-icons {
    font-size: 28px;
}
.card-unificado .stat-content h3 {
    font-size: 32px;
    margin: 0;
}
.card-unificado .chart-header {
    padding: 16px;
    border-bottom: 1px solid var(--background-dark);
    background-color: var(--background-secondary);
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}
.card-unificado .chart-header h3 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}
.card-unificado .chart,
.card-unificado .classificacao-table,
.card-unificado .ranking-table {
    width: 100%;
    height: 100%;
    padding: 16px;
    text-align: center;
    flex-grow: 1;
    overflow-y: auto;
}
/* ==========================
   TABELAS
========================== */
.ranking-table table,
.classificacao-table table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 auto;
}
.ranking-table th,
.classificacao-table th,
.ranking-table td,
.classificacao-table td {
    padding: 12px;
    border: 1px solid var(--background-dark);
    text-align: center;
    font-size: 16px;
    word-wrap: break-word;
}
.ranking-table th,
.classificacao-table th {
    background-color: var(--primary-light);
    color: var(--text-white);
    font-weight: 600;
}
.ranking-table tr:nth-child(even),
.classificacao-table tr:nth-child(even) {
    background-color: #f0f0f0;
}
.ranking-table th:nth-child(1),
.classificacao-table th:nth-child(1),
.ranking-table td:nth-child(1),
.classificacao-table td:nth-child(1) {
    width: 15%;
}
.ranking-table th:nth-child(2),
.classificacao-table th:nth-child(2),
.ranking-table td:nth-child(2),
.classificacao-table td:nth-child(2) {
    width: 55%;
    text-align: left;
}
.ranking-table th:nth-child(3),
.classificacao-table th:nth-child(3),
.ranking-table td:nth-child(3),
.classificacao-table td:nth-child(3) {
    width: 30%;
}
.ranking-table th,
.ranking-table td {
    padding: 6px;
    font-size: 13px;
}




/* ==========================
   SCROLLBAR
========================== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--background-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--text-disabled);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
/* ==========================
   RESPONSIVO
========================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 32px;
    }
}
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
    .dashboard-header h1 {
        font-size: 36px;
    }
}
@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 28px;
    }
}
/* ==========================
   ANIMAÇÕES
========================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 2) Cada card flexível fica com min-height e distribui bem seu conteúdo */
.card-unificado {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* ou space-between, se quiser separar título/do conteúdo */
    align-items: center;
    min-height: 200px;         /* altura mínima — ajuste conforme seu layout */
    padding: 32px;
    /* sem height fixo! */
}

/* 3) Se você quiser que os ícones, número e texto fiquem espaçados uniformemente: */
.card-unificado .stat-icon,
.card-unificado .stat-content {
    flex-shrink: 0;
}

/* 4) Se algum card precisar de scroll interno (como tabela longa), isole só nele: */
.card-unificado.scrollable {
    overflow-y: auto;
    /* aí você adiciona essa classe apenas nos cards de tabela */
}

/* Remove qualquer height fixo ou overflow aplicado globalmente */
.card-unificado {
    height: 480px;
    overflow-y: visible;
}



/* CARD-STAT: os 3 cards do topo, mais "finos" */
.card-unificado.card-stat {
    min-height: 80px;     /* ajuste conforme a sua necessidade */
    max-height: 180px;     /* garante que não cresçam demais */
    padding: 24px;         /* menos padding para ficarem “mais finos” */
    justify-content: center; /* centra conteúdo verticalmente */
}

/* Conteúdo interno dos estatísticos nunca encolhe, só cresce se precisar */
.card-unificado.card-stat .stat-icon,
.card-unificado.card-stat .stat-content {
    flex-shrink: 0;
}

/* Se precisar de scroll só nos outros cards (tabelas, gráficos etc.) */
.card-unificado:not(.card-stat) {
    overflow-y: auto;
}

/* ======================================================
   GRID DE BOTÕES (ajustado para ficar mais largo e centralizado)
====================================================== */

/* Centraliza o container na tela toda */
.content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height));
    padding: 24px;
}

/* Grade de botões ajustada */
.button-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 16px;
    max-width: 900px;
    width: 100%;
}

/* Botão base uniforme */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 64px; /* altura um pouco maior */
    border: none;
    border-radius: var(--border-radius);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.1s ease;
    text-align: center;
    text-decoration: none; /* ✅ ESSA LINHA REMOVE A UNDERLINE */
}
.btn:hover {
    transform: translateY(-2px);
}

/* Cores individuais */
.btn-cronometro   { background-color: #d32f2f; }
.btn-notas        { background-color: #fbc02d; color: #ffffff; }
.btn-calculadora  { background-color: #ff9800; }
.btn-sorteio      { background-color: #7b1fa2; }
.btn-bingo        { background-color: #0288d1; }
.btn-zap          { background-color: #25d366; }

/* Ícones dentro dos botões */
.btn .material-icons,
.btn i.fab {
    font-size: 30px;
    line-height: 1;
}