/* ============================================
   2D Monitoramento Web - Estilos
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: #475569;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-light: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.4);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    /* Sizes */
    --sidebar-width: 240px;
    --header-height: 60px;
    --radius: 8px;
    --radius-lg: 12px;
}

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

html, body {
    /* Garantir interatividade em dispositivos touch */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    /* Garantir que body não bloqueie eventos */
    pointer-events: auto;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Dashboard Topbar (No Sidebar Layout)
   ============================================ */

.dashboard-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-left .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-left .logo .logo-img {
    height: 28px;
    width: auto;
}

.topbar-left .logo .logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.topbar-left .logo .logo-separator {
    color: var(--text-muted);
    margin: 0 0.25rem;
}

.topbar-left .logo .dashboard-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.topbar-left .logo .logo-page {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Botão de notificações no header */
.topbar-notifications {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.topbar-notifications .notification-icon {
    font-size: 1rem;
}

/* Botão de refresh no header */
.topbar-refresh {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.topbar-refresh .icon {
    width: 16px;
    height: 16px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topbar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.topbar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.topbar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.topbar-nav-item .icon {
    width: 16px;
    height: 16px;
}

.topbar-user {
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user .user-info .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.topbar-user .user-info .name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.topbar-user .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-user .btn svg {
    margin: 0;
}

/* No Sidebar Layout */
body.no-sidebar .main-content {
    margin-left: 0;
    padding-top: 70px; /* Account for topbar (56px + spacing) */
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-title .icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-actions .btn {
    white-space: nowrap;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Summary Cards - Simplificados */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.summary-card-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.summary-card-info h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Card Status */
.status-values {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-badge.online {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.status-badge.offline {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.85); }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.status-divider {
    color: var(--text-muted);
    font-weight: 400;
}

.status-total {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Card Ping */
.ping-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.ping-max {
    color: var(--warning);
}

.ping-min {
    color: var(--success);
}

.ping-label {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ping-divider {
    color: var(--text-muted);
    font-weight: 400;
}

.ping-hosts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.ping-hosts .host-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Icons */
.summary-card-icon {
    padding: 0.6rem;
    border-radius: var(--radius);
}

.summary-card-icon .icon {
    width: 20px;
    height: 20px;
}

.summary-card-icon.status {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.summary-card-icon.ping {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* ============================================
   Filters
   ============================================ */

.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group .icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.filters-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filters Toggle (Mobile) */
.filters-toggle-btn {
    display: none; /* Hidden by default (desktop) */
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    /* Touch optimization */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.filters-toggle-btn:hover {
    background: var(--bg-tertiary);
}

.filters-toggle-btn:active {
    background: var(--bg-tertiary);
    transform: scale(0.98);
}

.filters-toggle-btn .icon {
    width: 18px;
    height: 18px;
}

.filters-toggle-btn .chevron {
    transition: transform 0.2s ease;
}

.filters-bar.filters-open .filters-toggle-btn .chevron {
    transform: rotate(180deg);
}

.filters-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    touch-action: manipulation;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Checkbox customizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label:hover {
    color: var(--text-secondary);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon:active {
    background: var(--bg-tertiary);
    transform: scale(0.95);
}

.btn-icon .icon, .btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(15, 23, 42, 0.5);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

tr:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* Destacar linhas com host online */
tr.host-online {
    background: rgba(16, 185, 129, 0.04);
    border-left: 3px solid var(--success);
    border-right: 3px solid var(--success);
}

tr.host-online:hover {
    background: rgba(16, 185, 129, 0.1);
}

tr.host-offline {
    background: rgba(239, 68, 68, 0.02);
    border-left: 3px solid var(--danger);
    border-right: 3px solid var(--danger);
}

tr.host-offline:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* ============================================
   Status Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    transition: all 0.2s;
}

.badge-online, .status-online, .badge-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success-border);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-success 2s infinite;
    font-weight: 600;
}

.badge-success::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

@keyframes pulse-success {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

.badge-offline, .status-offline, .badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-danger::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
}

.badge-unknown, .status-unknown, .badge-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-warning::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Criticidade Badges */
.badge-alta {
    background: transparent;
    color: var(--text-primary);
    border: none;
}

.badge-media {
    background: transparent;
    color: var(--text-primary);
    border: none;
}

.badge-baixa {
    background: transparent;
    color: var(--text-primary);
    border: none;
}

/* ============================================
   Modal
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Garantir que eventos touch funcionem corretamente */
    -webkit-tap-highlight-color: transparent;
    overflow-y: auto;
    /* Garantir que modal receba eventos de toque */
    pointer-events: auto;
}

.modal.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    /* Garantir que não interfira quando oculto */
    opacity: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    /* Backdrop não captura eventos, permite cliques passarem */
    pointer-events: none;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10;
    /* Modal content DEVE capturar eventos */
    pointer-events: auto;
}

.modal-content.modal-lg {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ============================================
   Toast Notifications
   ============================================ */

#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* IMPORTANTE: Permitir que cliques passem quando não há toasts */
    pointer-events: none;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    /* Toasts individuais capturam cliques */
    pointer-events: auto;
}

.toast.success {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    background: var(--danger-light);
    color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Loading
   ============================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-alert {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    }
}

.loading p {
    margin-top: 1rem;
    color: var(--text-muted);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ============================================
   Error Message
   ============================================ */

.error-message {
    padding: 0.75rem;
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.error-message.hidden {
    display: none;
}

/* ============================================
   User Info
   ============================================ */

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
}

.user-info .name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
    display: none !important;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }

.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
    }
    
    .sidebar-header, .sidebar-footer {
        display: none;
    }
    
    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        padding: 0.5rem;
    }
    
    .nav-item {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: 60px;
    }
    
    body.no-sidebar .main-content {
        padding-top: 60px;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-left, .filters-right {
        width: 100%;
    }
}
/* ============================================
   Mobile Responsive - até 768px
   ============================================ */
@media (max-width: 768px) {
    /* Esconder elementos no mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Topbar compacta - apenas ícones */
    .dashboard-topbar {
        height: 48px;
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    
    /* Logo - esconder textos extras */
    .logo-text,
    .logo-separator,
    .dashboard-icon,
    .logo-page {
        display: none;
    }
    
    .logo-img {
        height: 24px;
    }
    
    .topbar-right {
        gap: 0.5rem;
    }
    
    /* Notificações - apenas ícone */
    .topbar-notifications {
        padding: 0.35rem 0.5rem;
        min-width: auto;
    }
    
    /* Refresh - apenas ícone no mobile */
    .topbar-refresh {
        padding: 0.35rem 0.5rem;
        min-width: auto;
    }
    
    /* Nav items - apenas ícones */
    .topbar-nav {
        gap: 0.25rem;
    }
    
    .topbar-nav-item {
        padding: 0.35rem 0.5rem;
    }
    
    .topbar-nav-item span {
        display: none;
    }
    
    .topbar-nav-item .icon {
        width: 18px;
        height: 18px;
    }
    
    /* Topbar user - apenas ícone de logout */
    .topbar-user {
        padding-left: 0;
        border-left: none;
        gap: 0;
    }
    
    .topbar-user .user-info {
        display: none;
    }
    
    .topbar-user .btn {
        padding: 0.35rem 0.5rem;
        min-width: auto;
    }
    
    /* Page header compacto */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .page-title p {
        font-size: 0.75rem;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Summary cards responsivos - lado a lado */
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .summary-card {
        padding: 0.75rem;
    }
    
    .summary-card h3 {
        font-size: 0.8rem;
    }
    
    .status-values {
        gap: 0.5rem;
    }
    
    .status-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .status-indicator {
        width: 6px;
        height: 6px;
    }
    
    .ping-values {
        font-size: 0.9rem;
    }
    
    .status-total,
    .ping-hosts {
        font-size: 0.7rem;
    }
    
    /* Filtros com collapse no mobile */
    .filters-bar {
        padding: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-bottom: 1rem;
    }
    
    /* Toggle button visível no mobile */
    .filters-toggle-btn {
        display: flex;
        margin-bottom: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Filtros ocultos por padrão no mobile */
    .filters-content {
        display: none;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        flex-direction: column;
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        background: var(--bg-card);
    }
    
    /* Mostrar filtros quando aberto */
    .filters-bar.filters-open .filters-content {
        display: flex;
    }
    
    /* Ajustar botão quando aberto */
    .filters-bar.filters-open .filters-toggle-btn {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom-color: transparent;
    }
    
    .filters-left {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-group {
        width: 100%;
        gap: 0.5rem;
    }
    
    .filter-group .icon {
        display: flex;
        width: 16px;
        height: 16px;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .filters-right {
        width: 100%;
        flex-direction: row;
        gap: 0.35rem;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
    
    /* Botões - apenas ícones no mobile */
    .filters-right .btn {
        padding: 0.4rem 0.5rem;
        min-width: auto;
    }
    
    .filters-right .btn:not(.btn-icon-only) {
        font-size: 0;
    }
    
    .filters-right .btn .icon {
        width: 18px;
        height: 18px;
        margin: 0;
    }
    
    /* Tabela responsiva */
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: auto;
    }
    
    table th,
    table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Rows clicáveis no mobile */
    table tbody tr {
        cursor: pointer;
    }
    
    table tbody tr:active {
        background: var(--bg-tertiary);
    }
    
    /* Esconder hostname no nome quando mobile */
    .hostname-sub {
        display: none;
    }
    
    /* Main content padding */
    body.no-sidebar .main-content {
        padding: 60px 0.75rem 1rem;
    }
    
    /* Cards gerais */
    .card {
        border-radius: var(--radius);
    }
    
    /* Modais no mobile - garantir que sejam clicáveis */
    .modal {
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        /* Garantir que o conteúdo esteja acima do backdrop */
        z-index: 10;
        /* Evitar problemas de touch */
        -webkit-tap-highlight-color: transparent;
        touch-action: auto;
    }
    
    .modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-body {
        max-height: calc(100vh - 140px);
        /* Permitir scroll touch */
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
    
    /* Toast notifications */
    #toast-container {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
    }
}

/* Mobile pequeno - até 480px */
@media (max-width: 480px) {
    /* Topbar ainda mais compacta */
    .dashboard-topbar {
        height: 44px;
        padding: 0 0.5rem;
    }
    
    .logo-img {
        height: 22px;
    }
    
    .topbar-nav-item {
        padding: 0.3rem 0.4rem;
    }
    
    .topbar-nav-item .icon {
        width: 16px;
        height: 16px;
    }
    
    .topbar-notifications {
        padding: 0.3rem 0.4rem;
    }
    
    .topbar-refresh {
        padding: 0.3rem 0.4rem;
    }
    
    /* Botões menores */
    .filters-right .btn {
        padding: 0.3rem 0.4rem;
    }
    
    .filters-right .btn .icon {
        width: 16px;
        height: 16px;
    }
    
    /* Main content padding menor */
    body.no-sidebar .main-content {
        padding: 56px 0.5rem 1rem;
    }

    .summary-card-icon {
        display: none;
    }
    
    .status-values,
    .ping-values {
        flex-wrap: wrap;
    }
    
    .ping-hosts {
        flex-wrap: wrap;
    }
}

/* ============================================
   Mobile Touch Fix - Garantir que elementos sejam clicáveis
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Dispositivos touch - garantir interatividade */
    button,
    a,
    input,
    select,
    textarea,
    .btn,
    .btn-icon,
    .nav-item,
    .topbar-nav-item,
    .filters-toggle-btn,
    [onclick],
    [role="button"] {
        cursor: pointer;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
        touch-action: manipulation;
    }
    
    /* Aumentar área de toque em botões */
    .btn, .btn-icon {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Garantir que modais hidden não interfiram */
    .modal.hidden,
    .modal.hidden * {
        pointer-events: none !important;
        display: none !important;
    }
}