/* style.css - Layout Profissional, Barra de Pesquisa Fixa e Full Width */
:root {
    --bg-body: #0f1012;
    --bg-card: #1a1c20;
    --bg-input: #25282e;
    
    /* Cores do Tema */
    --primary: #00b4ff;
    --primary-hover: #0091cc;
    --secondary: #ffa733;
    --success: #00c853;       
    --danger: #ff3d00;        
    
    --text-main: #ececec;
    --text-muted: #9ca3af;
    --border: #2d333b;
    --radius: 6px;
    --site-width: 1400px; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-bottom: 80px;
    font-size: 15px;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }

/* === NAVBAR === */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: 60px;
    position: sticky; top: 0; z-index: 1000; width: 100%;
}
.nav-content {
    max-width: var(--site-width);
    margin: 0 auto; padding: 0 20px; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-brand img { height: 35px; width: auto; }

/* Correção aplicada aqui: list-style: none para remover os pontos */
.nav-menu { 
    display: flex; 
    gap: 5px; 
    height: 100%; 
    align-items: center; 
    list-style: none; /* Remove as bolinhas brancas */
    margin: 0;
    padding: 0;
}

.nav-link, .dropdown-toggle {
    padding: 0 12px; height: 100%; display: flex; align-items: center; gap: 8px;
    color: var(--text-muted); font-weight: 500; cursor: pointer; font-size: 0.9em;
}
.nav-link:hover, .dropdown-toggle:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.05); }

/* Dropdowns */
.dropdown { position: relative; height: 100%; }
.dropdown-menu {
    display: none; position: absolute; top: 60px; left: 0;
    background: #22252a; border: 1px solid var(--border); min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 100; border-radius: 0 0 var(--radius) var(--radius);
    list-style: none; /* Garante que dropdowns também não tenham pontos */
    padding: 0;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-item { padding: 10px 20px; display: flex; gap: 10px; color: #ccc; font-size: 0.9em; }
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--primary); }
.hamburger { display: none; font-size: 1.5rem; cursor: pointer; color: #fff; }

/* === LAYOUT GLOBAL === */
.container {
    max-width: var(--site-width);
    margin: 25px auto;
    padding: 0 20px;
    width: 100%;
}

/* === DASHBOARD WIDGETS === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1;
}
.stat-card a {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}
.stat-card a:hover {
    color: var(--primary) !important;
    text-decoration: underline;
}

/* === TOOLBAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    width: 100%;
}

.search-group {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-grow: 1; 
    max-width: 600px;
}
.search-group input {
    border: none; background: transparent; padding: 10px 15px; color: #fff; width: 100%; outline: none;
}
.search-group button {
    background: var(--bg-input); border: none; border-left: 1px solid var(--border);
    color: var(--text-muted); padding: 0 20px; cursor: pointer; transition: 0.2s;
}
.search-group button:hover { background: var(--primary); color: #fff; }

/* === FORMULÁRIOS E TABELAS === */
.form-card, .tabela-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    width: 100%; 
    overflow: hidden;
}
.form-card { padding: 25px; }

.input-wrapper { position: relative; margin-bottom: 5px; }
.input-wrapper i { position: absolute; top: 11px; left: 12px; color: #666; }
.input-wrapper input, .input-wrapper select, .input-wrapper textarea {
    width: 100%; padding: 10px 10px 10px 38px;
    background: var(--bg-input); border: 1px solid var(--border);
    color: #fff; border-radius: var(--radius); font-size: 0.95rem;
}
.input-wrapper input:focus { border-color: var(--primary); outline: none; }

.grid-row { display: grid; gap: 15px; margin-bottom: 15px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-section label { display: block; margin-bottom: 5px; color: var(--secondary); font-size: 0.85em; font-weight: 600; }

/* Tabela */
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { 
    background: #22252a; text-align: left; padding: 15px; 
    border-bottom: 1px solid var(--border); color: #888; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.5px;
}
.tabela td { padding: 12px 15px; border-bottom: 1px solid #333; color: #ddd; vertical-align: middle; font-size: 0.95em; }
.tabela tr:last-child td { border-bottom: none; }
.tabela tr:hover { background-color: rgba(255,255,255,0.02); }

/* === BOTÕES === */
.btn { 
    padding: 8px 16px; border-radius: var(--radius); border: none; cursor: pointer; 
    font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9rem; text-decoration: none;
}
.btn-sm { padding: 5px 10px; font-size: 0.85rem; height: 32px; width: 32px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #3a3f47; color: #eee; }
.btn-danger { background: var(--danger); color: #fff; }

/* Botões Pequenos de Ação */
.btn-icon-small {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px; color: #fff;
    border: none; cursor: pointer; transition: transform 0.2s, filter 0.2s;
    text-decoration: none;
}
.btn-icon-small:hover { transform: scale(1.1); filter: brightness(110%); }
.btn-icon-small i { font-size: 1.1em; }

.bg-call { background: linear-gradient(135deg, #00c853, #009624); }
.bg-save { background: linear-gradient(135deg, #ff9800, #f57c00); }
.bg-view { background: #333; border: 1px solid #555; color: var(--primary); }
.bg-view:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* === MOBILE === */
@media (max-width: 900px) {
    .hamburger { display: block; }
    .nav-menu { 
        position: fixed; top: 60px; left: -100%; width: 100%; height: calc(100vh - 60px);
        background: #1a1c20; flex-direction: column; padding: 20px; transition: 0.3s; overflow-y: auto;
    }
    .nav-menu.active { left: 0; }
    .nav-link { width: 100%; padding: 15px; font-size: 1.1rem; }
    .nav-user { display: none; }
    
    .toolbar { flex-direction: column-reverse; align-items: stretch; }
    .search-group { max-width: 100%; }
    
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    
    .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(100%, 1fr)); }

    /* Tabela em Cartões */
    .tabela thead { display: none; }
    .tabela tr { display: block; margin-bottom: 15px; background: #22252a; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
    .tabela td { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #333; text-align: right; }
    .tabela td::before { content: attr(data-label); font-weight: bold; color: var(--primary); font-size: 0.75em; text-transform: uppercase; }
    .tabela td:last-child { border: none; justify-content: flex-end; padding-top: 15px; gap: 5px; }
}
/* --- CORREÇÃO DO BOTÃO MAPA (INPUT GROUP) --- */
.input-group {
    display: flex;
    align-items: stretch; /* Garante que input e botão têm a mesma altura */
    width: 100%;
}

.input-group input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none; /* Remove a borda entre eles */
    flex-grow: 1; /* Ocupa o espaço todo */
}

.input-group button {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin: 0;
    border: 1px solid #444; /* Borda igual ao input */
    background-color: #333;
    color: #00b4ff;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    white-space: nowrap; /* Impede que o texto quebre */
}

.input-group button:hover {
    background-color: #00b4ff;
    color: white;
    border-color: #00b4ff;
}
/* --- ADICIONAR NO FIM DO STYLE.CSS --- */

/* Classe para mostrar o dropdown quando clicado (Mobile) */
.dropdown-menu.show { display: block !important; }

/* Ajuste Opcional: Melhorar visual do dropdown em telemóvel */
@media(max-width: 900px) {
    .dropdown-menu {
        position: absolute; /* Ou 'fixed' se preferires centrado */
        right: 0; 
        left: auto;
        min-width: 200px;
        background: #25282e;
        border: 1px solid #444;
    }
}