/* style.css - JHOST Portal Corporativo 
    Versão Completa 1.0
*/

:root {
    /* Paleta de Cores JHOST */
    --primary: #151540;   /* Azul Marinho Profundo (Logo Fundo) */
    --primary-light: #2a2a60; 
    --accent: #ff8500;    /* Laranja Vibrante (Logo Chave) */
    --accent-hover: #e07600;
    
    /* Cores de Texto e Fundo */
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --bg-light: #f4f6f9;  /* Cinza azulado bem claro para fundo */
    --white: #ffffff;
    
    /* Feedback */
    --danger: #d32f2f;
    --success: #2e7d32;
    --warning: #ed6c02;
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    height: 100%;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- ESTRUTURA (STICKY FOOTER) --- */
/* Garante que o rodapé fique no chão mesmo com pouco conteúdo */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1; /* Ocupa o espaço restante */
    width: 100%;
    max-width: 1200px; /* Largura máxima do conteúdo */
    margin: 0 auto;    /* Centraliza na tela */
    padding: 30px;
}

/* --- TELA DE LOGIN (PÁGINA ÚNICA) --- */
.login-bg {
    background-color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo-img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.logo-area p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: -5px;
    margin-bottom: 25px;
}

/* --- CABEÇALHO (TOPBAR) --- */
.topbar {
    background: var(--white);
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-logo {
    height: 40px; /* Ajuste conforme a proporção da sua imagem */
    width: auto;
    display: block;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
    line-height: 1.2;
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.user-role-badge {
    font-size: 0.75rem;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-light);
    border: 1px solid #ddd;
}

.btn-sair {
    color: var(--danger);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}
.btn-sair:hover { background: #ffebee; }

/* --- RODAPÉ --- */
.main-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

.footer-content strong { color: var(--white); }
.footer-links { margin-top: 5px; }
.footer-links a { color: var(--accent); font-weight: 600; margin: 0 5px; }
.footer-links a:hover { text-decoration: underline; color: var(--accent-hover); }

/* --- DASHBOARD WIDGETS (CARDS) --- */
.dashboard-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}
.dashboard-header h1 { margin: 0; color: var(--primary); }
.dashboard-header p { color: var(--text-light); margin: 5px 0 0 0; }

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

.card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--accent);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: var(--bg-light);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.card h3 { margin: 0 0 10px 0; color: var(--primary); }
.card p { color: var(--text-light); margin: 0 0 20px 0; font-size: 0.9rem; }

/* --- FORMULÁRIOS E BOTÕES --- */
.form-group { margin-bottom: 15px; text-align: left; }

.form-group label { 
    display: block; margin-bottom: 6px; 
    font-weight: 600; font-size: 0.9em; color: var(--primary);
}

.form-group input, 
.form-group select, 
.form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    background: #fafafa;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    background: var(--white);
    outline: none;
}

button, .btn-padrao {
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    display: inline-block;
    text-align: center;
}

button:hover, .btn-padrao:hover {
    background: var(--accent-hover);
}

/* --- ALERTAS --- */
.alert-erro {
    background: #ffebee;
    color: var(--danger);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #ffcdd2;
    font-size: 0.9rem;
}

.alert-sucesso {
    background: #e8f5e9;
    color: var(--success);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #c8e6c9;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 600px) {
    .topbar { padding: 0 15px; }
    .user-info { display: none; } /* Esconde nome no mobile pra economizar espaço */
    .btn-sair { margin-left: auto; }
    .main-content { padding: 20px; }
}
/* --- WIDGETS PERSONALIZADOS (Adicione ao final do style.css) --- */

/* Estilo Base dos Widgets */
.card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 4px solid transparent; /* Faixa colorida lateral */
}

.widget-icon-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.icon-box {
    font-size: 1.8rem;
    background: var(--bg-light);
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
}

.badge-count {
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: bold;
}

.widget-body h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.valor-destaque {
    font-size: 1.8rem;
    color: var(--primary);
    margin: 5px 0;
}

.widget-footer {
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* --- CORES ESPECÍFICAS POR TIPO --- */

/* CRM / Leads (Laranja) */
.widget-leads { border-left-color: #e67e22; }
.widget-leads .icon-box { color: #e67e22; background: #fff5e6; }

/* Orçamentos (Azul ou Alerta) */
.widget-orcamentos { border-left-color: #3498db; }
.widget-orcamentos.status-alerta .valor-destaque { color: #e67e22; } /* Destaca o dinheiro */

/* Obras (Roxo/Indigo) */
.widget-obras { border-left-color: #8e44ad; }
.widget-obras .icon-box { color: #8e44ad; background: #f4ecf7; }

/* Financeiro (Verde) */
.widget-financeiro { border-left-color: #27ae60; }
.widget-financeiro .icon-box { color: #27ae60; background: #eafaf1; }

/* Fornecedores (Cinza) */
.widget-fornecedores { border-left-color: #7f8c8d; }

/* --- GRID DO DASHBOARD --- */
.grid-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}
/* Adicione isso junto com os outros temas (theme-orange, theme-blue...) */
    
    /* Teal (Vistorias) */
    .theme-teal { border-bottom-color: #1abc9c; }
    .theme-teal .icon-area { background: #e8f8f5; color: #1abc9c; }
    .theme-teal .valor-big, .theme-teal .widget-foot { color: #1abc9c; }

/* --- PÁGINA DE CADASTROS (usuarios.php) --- */

/* Filtros no topo */
.filtros-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding-bottom: 5px; /* Para scrollbar não colar */
}

.btn-filtro {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    white-space: nowrap;
}

.btn-filtro:hover {
    border-color: var(--primary-color, #151540);
    color: var(--primary-color, #151540);
}

.btn-filtro.active {
    background: var(--primary-color, #151540);
    color: white;
    border-color: var(--primary-color, #151540);
    box-shadow: 0 4px 10px rgba(21, 21, 64, 0.2);
}

/* Tabela de Usuários (Estilo Card Row) */
.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px; /* Espaço entre as linhas */
}

.user-row {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    z-index: 2;
}

.user-cell {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.user-cell:first-child {
    border-left: 1px solid #f0f0f0;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.user-cell:last-child {
    border-right: 1px solid #f0f0f0;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: right;
}

/* Avatar e Info */
.user-info-flex {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f4f6f9;
}

.user-nome {
    font-weight: 700;
    color: var(--primary-color, #151540);
    font-size: 0.95rem;
    display: block;
}

.user-email {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* Badges (Etiquetas de Nível) */
.badge-role {
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.role-admin { background: #ffebee; color: #e74c3c; }
.role-cliente { background: #e8f5e9; color: #2ecc71; }
.role-lead { background: #fff8e1; color: #f1c40f; border: 1px solid #fce8b2; }
.role-prestador { background: #e3f2fd; color: #3498db; }
.role-funcionario { background: #f3e5f5; color: #9b59b6; }

/* Ações (Botões da Tabela) */
.btn-icon-action {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    transition: background 0.2s;
}

.btn-edit { background: #f5f5f5; color: #555; }
.btn-edit:hover { background: #e0e0e0; color: #333; }

.btn-delete { background: #ffebee; color: #e74c3c; }
.btn-delete:hover { background: #ffcdd2; color: #c0392b; }

/* Botão Padrão (Caso não tenha globalmente) */
.btn-padrao {
    background: var(--primary-color, #151540);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.btn-padrao:hover {
    background: #2a2a50; /* Um tom mais claro */
    color: white;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .user-table, .user-table tbody, .user-table tr, .user-table td {
        display: block;
        width: 100%;
    }
    
    .user-row {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 12px;
    }
    
    .user-cell {
        padding: 10px 15px;
        text-align: left;
        border: none;
    }
    
    .user-cell:first-child { border-bottom: 1px solid #f9f9f9; }
    
    .user-cell:last-child {
        text-align: right;
        background: #fafafa;
        border-top: 1px solid #eee;
        border-radius: 0 0 12px 12px;
        padding: 10px;
    }
    
    /* Esconde cabeçalhos se tiver thead */
    .user-table thead { display: none; }
}