/* =========================================
   OLHOS ADM - DESIGN SYSTEM & GLOBAL
   ========================================= */

:root {
    /* Cores Principais */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #f59e0b;
    
    /* Cores de Feedback */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success-bg: #dcfce7;
    
    /* Neutros */
    --bg-body: #f1f5f9;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Sombras e Bordas */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   LAYOUT & CONTAINERS
   ========================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

nav {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* =========================================
   COMPONENTES DE FORMULÁRIO (UNIFICADO)
   ========================================= */

.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.input-group input, 
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--white);
    transition: all 0.2s;
    color: var(--text-main);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.input-group input:focus, 
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Grid para Filtros de Auditoria */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

/* =========================================
   BOTÕES E AÇÕES
   ========================================= */

.btn-login, .btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-login:hover, .btn-submit:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-action {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-senha { background: var(--bg-body); color: var(--text-main); }
.btn-logout { background: #fee2e2; color: var(--danger); }
.btn-logout:hover { background: var(--danger); color: white; }

/* =========================================
   TABELAS & AUDITORIA
   ========================================= */

.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1.2rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    transition: background 0.2s;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Estilos da Linha do Tempo de Auditoria */
.log-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    width: 180px;
    font-variant-numeric: tabular-nums;
}

.log-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.log-user {
    color: var(--primary);
    font-weight: 700;
    margin-right: 4px;
}

/* =========================================
   PAGINAÇÃO
   ========================================= */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0 3rem 0;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn:hover:not(.active) {
    background: var(--bg-body);
}

/* =========================================
   CARDS E GRIDS (DASHBOARD)
   ========================================= */

.welcome-card { margin: 2rem 0; text-align: left; }
.welcome-card h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.option-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.option-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.section-title {
    margin: 2rem 0 1.2rem 0;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

/* =========================================
   RESPONSIVIDADE
   ========================================= */

@media (max-width: 768px) {
    .options-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 1.5rem; }
}

@media (max-width: 600px) {
    .log-time { display: none; }
    .options-grid { grid-template-columns: 1fr; }
    nav { padding: 1rem; }
    .nav-actions .btn-action span { display: none; }
}

@media print {
    nav, .nav-actions, .option-card, .pagination, .btn-login {
        display: none !important;
    }

    body {
        background-color: white !important;
        padding: 0;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .table-container {
        box-shadow: none !important;
        border: 1px solid #eee !important;
    }

    th {
        background-color: #f8fafc !important;
        -webkit-print-color-adjust: exact;
    }

    .log-user {
        color: #2563eb !important;
        -webkit-print-color-adjust: exact;
    }

    .log-time {
        display: table-cell !important;
        font-size: 10pt !important;
    }
}

/* =========================================
   ESTILOS ESPECÍFICOS DA TELA DE LOGIN
   ========================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    /* Adicionando a nova imagem como background */
    background-image: 
    linear-gradient(rgba(241, 245, 249, 0.85), rgba(241, 245, 249, 0.7)),
    url('background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.login-card {
    /* Fundo branco semi-transparente para deixar os infográficos sutis por trás */
    background: rgba(255, 255, 255, 0.92); 
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
    text-align: center;
    /* Efeito de desfoque moderno no vidro */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.brand-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -2px;
    margin-bottom: 1rem;
}

.login-card h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.links-aux {
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.links-aux a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.links-aux a:hover {
    text-decoration: underline;
}

/* Utilitários do Login */
.hidden-select { 
    display: none !important; 
}

.error-alert { 
    display: none; 
    background: #fee2e2; 
    color: #b91c1c; 
    padding: 0.8rem; 
    border-radius: 8px; 
    margin-bottom: 1.5rem; 
    font-size: 0.85rem; 
    font-weight: 600;
    border: 1px solid #fecaca;
}

.select-wrapper {
    margin-bottom: 1rem;
}