/* Reset Básico */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f4f7f6;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
}

/* --- Formulários (Login, Register, Cadastrar) --- */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.form-container h2 {
    margin-top: 0;
    text-align: center;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Importante para o padding não quebrar o layout */
}
button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s;
}
button[type="submit"]:hover {
    background-color: #0056b3;
}
.form-container p {
    text-align: center;
    margin-top: 20px;
}
/* Mensagens de erro/sucesso */
.error { color: #D8000C; background: #FFD2D2; padding: 10px; border-radius: 4px; }
.success { color: #4F8A10; background: #DFF2BF; padding: 10px; border-radius: 4px; }


/* --- Navegação --- */
.navbar {
    background: #333;
    color: white;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar h1 {
    margin: 0;
    font-size: 1.5em;
}
.navbar a {
    color: white;
    text-decoration: none;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: 4px;
}
.navbar a:hover {
    background-color: #555;
}
.navbar a.active {
    background-color: #007bff;
}

/* --- Dashboard (index.php) --- */
.filter-bar {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.filter-bar select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 10px;
}
.filter-bar button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    margin-left: 10px;
}
.filter-bar button:hover {
    background-color: #5a6268;
}

.loja-grupo {
    margin-bottom: 30px;
}
.loja-grupo h2 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.dispositivo-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 20px;
    border-left: 7px solid;
    transition: all 0.2s ease-in-out;
}
.dispositivo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* Cores dos Status */
.status-VERDE { border-left-color: #4CAF50; }
.status-AMARELO { border-left-color: #FFC107; }
.status-VERMELHO { border-left-color: #F44336; }
.status-CINZA { border-left-color: #9E9E9E; }

.dispositivo-card h3 { margin: 0 0 10px 0; }
.dispositivo-card p { margin: 5px 0; color: #555; }
.dispositivo-card .tipo { font-style: italic; font-size: 0.9em; color: #777; }
.dispositivo-card .ip { font-family: 'Courier New', Courier, monospace; color: #0056b3; font-weight: 600; }
.dispositivo-card .status { font-weight: 600; }
.dispositivo-card .detalhes { font-size: 0.9em; color: #777; margin-top: 15px; border-top: 1px solid #eee; padding-top: 10px; }

/* --- Adições para gerenciar_dispositivos.php --- */

/* Grid para o formulário de cadastro */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Tabela de Dispositivos */
.table-container {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow-x: auto; /* Para responsividade em telas pequenas */
}

.device-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.device-table thead {
    background-color: #f4f7f6;
}

.device-table th,
.device-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.device-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.device-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Botões de Ação na Tabela */
.device-table .actions {
    display: flex;
    gap: 10px;
    white-space: nowrap;
}
.btn-edit, .btn-delete {
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-size: 0.9em;
}
.btn-edit {
    background-color: #007bff; /* Azul */
}
.btn-edit:hover {
    background-color: #0056b3;
}
.btn-delete {
    background-color: #dc3545; /* Vermelho */
}
.btn-delete:hover {
    background-color: #c82333;
}
/* --- Atualização do form-grid (para 3 colunas) --- */

@media (min-width: 768px) {
    .form-grid {
        /* Muda para 3 colunas em telas maiores */
        grid-template-columns: 1fr 1fr 1fr;
    }
}
.dispositivo-card .ip {
    word-wrap: break-word;      /* Fallback antigo */
    overflow-wrap: break-word;  /* Padrão */
    word-break: break-all;      /* Regra mais "agressiva" para garantir */
    
    /* Garante que o parágrafo não tente ser maior que o card */
    max-width: 100%; 
}