/* =========================
   RESET
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

/* =========================
   BODY
========================= */
body {
    background: #f4f6f9;
    color: #1f2d3d;
    text-align: center;
    padding: 20px;
}

/* =========================
   HEADER
========================= */
h1 {
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 700;
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

#last-update {
    font-size: 13px;
    color: #666;
}

/* =========================
   BOTÕES
========================= */
button {
    padding: 10px 16px;
    border: none;
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

button:hover {
    background: #1a252f;
    transform: translateY(-1px);
}

/* =========================
   CARDS
========================= */
.cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px auto;
    flex-wrap: wrap;
}

.card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    width: 160px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.card span {
    font-size: 12px;
    color: #666;
}

.card.online h2 { color: #2ecc71; }
.card.offline h2 { color: #e74c3c; }
.card.latency h2 { color: #3498db; }

/* =========================
   FILTROS
========================= */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px auto;
}

.filters input,
.filters select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    font-size: 14px;
    background: white;
}

/* =========================
   TABELA
========================= */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 95%;
    margin: auto;
    background: white;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    font-size: 12px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
}

td {
    padding: 12px;
    font-size: 13px;
    text-align: center;
}

tr:nth-child(even) {
    background: #f8f9fb;
}

tr:hover {
    background: #eef3f8;
}

/* =========================
   STATUS
========================= */
.status {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    display: inline-block;
    min-width: 80px;
}

.ONLINE { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.OFFLINE { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.UNKNOWN { background: #7f8c8d; }

/* =========================
   LINHA OFFLINE
========================= */
.offline-row {
    background: #fde8e8 !important;
}

/* =========================
   ANIMAÇÃO
========================= */
@keyframes pulseOffline {
    0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
    70% { box-shadow: 0 0 0 10px rgba(231,76,60,0); }
    100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

.pulse-offline {
    animation: pulseOffline 1.5s infinite;
}

/* =========================
   LINKS
========================= */
a {
    color: #2980b9;
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   TOAST
========================= */
#toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    opacity: 0;
    transition: 0.25s;
    font-size: 14px;
    z-index: 9999;
}

#toast.show {
    opacity: 1;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 768px) {
    .filters input,
    .filters select {
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
    }
}

/* =====================================================
   NOVAS PÁGINAS (HOSTS / FALHAS)
===================================================== */

/* CONTAINER */
.page-container {
    max-width: 1100px;
    margin: auto;
    text-align: left;
}

/* HEADER PAGE */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* FORM */
.form-box {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.form-grid input,
.form-grid select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
}

/* BOTÕES */
.btn-primary { background: #1976d2; }
.btn-danger { background: #e74c3c; }
.btn-warning { background: #f39c12; }
.btn-secondary { background: #7f8c8d; }

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* AÇÕES */
.table-actions {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* VOLTAR */
.link-voltar {
    display: inline-block;
    margin-bottom: 15px;
}

/* FALHAS */
.falha-card {
    background: white;
    border-left: 5px solid #e74c3c;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.falha-card.online {
    border-left-color: #2ecc71;
}
/* =========================
   AÇÕES (ICONS DISCRETOS)
========================= */
.action-icon {
    cursor: pointer;
    font-size: 14px;
    margin: 0 6px;
    transition: 0.2s;
    opacity: 0.7;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* EDITAR */
.action-icon.edit {
    color: #3498db;
}

/* DELETAR */
.action-icon.delete {
    color: #e74c3c;
}