:root {
    --bg-main: #0f1115;
    --bg-card: #181a20;
    --bg-header: #1f222a;
    --border: #2a2d36;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --green: #00e676;
    --yellow: #ffd740;
    --red: #ff1744;
}
* { box-sizing: border-box; }

body {
    margin: 0; padding: 20px; font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(180deg, #0f1115, #0b0d11);
    color: var(--text-main); min-height: 100vh;
}

/* Header Comum */
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border); padding-bottom: 15px; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.header-logo { height: 60px; object-fit: contain; }
h1 { margin: 0; font-size: 3rem; text-transform: uppercase; font-weight: 800; color: #fff; text-align: center; }
.clock { font-family: monospace; font-size: 2.5rem; color: var(--green); font-weight: bold; margin: 0 15px; white-space: nowrap; }
button { cursor: pointer; border-radius: 6px; transition: 0.3s; }

/* Botões Header */
.btn-header { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 12px; font-size: 1.2rem; }
.btn-header:hover { color: #fff; border-color: #fff; }

/* Login Styles */
.login-container { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--bg-card); padding: 40px; border-radius: 12px; border: 1px solid var(--border); width: 100%; max-width: 400px; text-align: center; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; color: var(--text-muted); margin-bottom: 5px; }
.input-group input, .filtros-card select, .filtros-card input { width: 100%; padding: 12px; background: var(--bg-main); border: 1px solid var(--border); color: #fff; border-radius: 6px; font-size: 1rem; }
.btn-primary { width: 100%; padding: 12px; background: var(--green); color: #000; border: none; font-weight: bold; font-size: 1rem; }
.btn-primary:hover { background: #00c853; }
.error-msg { color: var(--red); display: none; margin-top: 10px; }

/* Dashboard Styles */
.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.card { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.card-header { background: var(--bg-header); padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.card-title { font-size: 1.4rem; font-weight: 700; color: #fbbf24; }
.badge { font-size: 1rem; padding: 5px 10px; border-radius: 4px; font-weight: 800; white-space: nowrap; }

/* Grid da Linha: Nome | CPM | Status | Barra */
.line { display: grid; grid-template-columns: 2fr 1.3fr 1fr 2fr; gap: 10px; padding: 12px 15px; align-items: center; border-bottom: 1px solid #2a2a2a; }
.status { padding: 4px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; text-align: center; text-transform: uppercase; }
.green { color: var(--green); background: rgba(0,230,118,0.1); border: 1px solid rgba(0,230,118,0.3); }
.yellow { color: var(--yellow); background: rgba(255,215,64,0.1); border: 1px solid rgba(255,215,64,0.3); }
.red { color: var(--red); background: rgba(255,23,68,0.1); border: 1px solid rgba(255,23,68,0.3); }
.progress { width: 100%; height: 8px; background: #333; border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; transition: width 0.4s; }

/* Relatórios */
.filtros-card { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid var(--border); display: flex; gap: 15px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.chart-container { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid var(--border); height: 500px; position: relative; }

/* --- ESTILO DO RODAPÉ --- */
footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border); /* Linha sutil separando */
}

.footer-logo {
    height: 50px; /* Ajuste a altura conforme sua imagem */
    object-fit: contain;
    margin-bottom: 5px;
}

.copyright {
    font-size: 0.9rem;
    color: #fff; /* "developed by" em branco */
}

.copyright strong {
    font-weight: 700; /* "Guaravita" em negrito */
}

.copyright span {
    color: var(--text-muted); /* "v1.1.0..." em cinza */
}

/* =========================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================= */

/* Tablets e Notebooks Pequenos (até 1200px) */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr); /* 2 Colunas */
    }
}

/* Celulares (até 768px) */
@media (max-width: 768px) {
    body { padding: 10px; }
    
    /* Layout vira uma coluna só */
    .grid-container { grid-template-columns: 1fr; }

    /* --- HEADER MOBILE --- */
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding-bottom: 20px;
    }
    /* Garante que todas as partes do header fiquem centralizadas */
    header > div {
        width: 100%;
        justify-content: center !important;
    }

    /* OCULTA ITENS DESNECESSÁRIOS NO MOBILE */
    .clock, .btn-fullscreen {
        display: none !important;
    }

    /* Alinha e aumenta os botões restantes (Relatórios e Sair) */
    .header-right {
        gap: 25px; /* Espaço entre os botões */
        align-items: center;
    }
    .btn-header {
        padding: 12px 30px; /* Botões maiores e mais largos para o dedo */
        font-size: 1.3rem; /* Ícone/Texto maior */
        border-width: 2px; /* Borda mais visível */
    }
    /* Título menor */
    h1 { font-size: 1.5rem; margin: 10px 0; }
    .header-logo { height: 50px; }
    /* --- FIM HEADER MOBILE --- */


    /* Relatórios: Filtros um embaixo do outro */
    .filtros-card {
        flex-direction: column;
        align-items: stretch;
    }
    .filtros-card .input-group, .filtros-card button {
        width: 100%;
        margin-right: 0;
    }
    .chart-container { height: 350px; }

    /* Card da Linha */
    .card-title { font-size: 1.2rem; }
    .line {
        grid-template-columns: 1.5fr 1fr 1fr; 
        font-size: 0.9rem;
        padding: 15px 10px; /* Mais espaço para toque na linha */
    }
    .progress { display: none; }
    .line-name {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}