:root {
    --primary-color: #1976d2;
    --secondary-color: #42a5f5;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --gradient-primary: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
    --gradient-secondary: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
}

.header img {
    height: 50px;
    margin-right: 15px;
}

.header h1 {
    margin: 0;
    color: #333;
    font-size: 1.8rem;
}

.header-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

/* Summary Cards */
.summary-cards {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
    min-width: 120px;
    max-width: 180px;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-cards.compact-cards {
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.summary-cards.compact-cards .summary-card {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    background: #fff;
    text-align: center;
    margin: 0;
    font-size: 0.95rem;
}

.summary-card h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.3rem;
    font-weight: bold;
}

.summary-card p {
    margin: 0;
    color: var(--dark-gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-online h3 { color: var(--success-color); }
.card-offline h3 { color: var(--danger-color); }
.card-unknown h3 { color: var(--warning-color); }
.card-total h3 { color: var(--primary-color); }
.card-max-response h3 { color: var(--secondary-color); }
.card-min-response h3 { color: #0d47a1; }

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    min-width: 0;
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

.filter-select, .filter-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 140px;
    margin-bottom: 0;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Dashboard Top */
.dashboard-top {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 0;
}

.table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    min-width: 600px;
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: 1rem;
    border: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: none;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    text-align: center;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background-color: #d4edda;
    color: #155724;
}

.status-offline {
    background-color: #f8d7da;
    color: #721c24;
}

.status-unknown {
    background-color: #fff3cd;
    color: #856404;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}

.btn {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    border-radius: 4px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Refresh Button Animation */
.btn-refresh-table .refresh-icon {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(.4,2,.3,1);
}

.btn-refresh-table.refreshing .refresh-icon {
    animation: spin-refresh 1s linear infinite;
}

@keyframes spin-refresh {
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .container {
        padding: 0.5rem;
        max-width: 100vw;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.7rem 0.5rem;
        min-height: unset;
    }
    .header-left {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: flex-start;
    }
    .header-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    .dashboard-top {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .summary-cards.compact-cards {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        justify-content: flex-start;
    }
    .summary-card {
        min-width: 120px;
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem;
    }
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        min-width: 0;
        padding: 0.5rem 0;
    }
    .filter-group {
        margin-right: 0;
        gap: 0.3rem;
    }
    .table-container {
        margin-top: 0.5rem;
        border-radius: 0;
        box-shadow: none;
        overflow-x: auto;
    }
    .table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    .table thead th, .table tbody td {
        padding: 0.35rem 0.2rem;
    }
    .action-buttons {
        flex-direction: row;
        gap: 0.3rem;
    }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1rem;
    }
    .summary-card h3 {
        font-size: 0.95rem;
    }
    .summary-card p {
        font-size: 0.65rem;
    }
    .table {
        font-size: 0.75rem;
        min-width: 400px;
    }
    .container {
        padding: 0.2rem;
    }
}

.high-criticality {
    background-color: #f8d7da; /* Light red background */
    color: #721c24; /* Dark red text */
    font-weight: bold; /* Bold text */
}
