/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    padding: 2rem;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
    position: relative;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 0.4rem;
    padding: 0;
}

.back-btn:hover {
    color: var(--text-main);
    transform: translateX(-4px);
}

.modal-title-group {
    flex-grow: 1;
}

#modal-hostname {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

/* Modal Views */
.modal-view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.modal-view.active {
    display: block;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.menu-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.menu-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-light);
}

.menu-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.tab-content {
    margin-top: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
    word-break: break-all;
}

/* Sensor filter buttons */
.sensor-filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sensor-filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sensor-filter-btn.active {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #000000 !important;
    font-weight: 600 !important;
}


/* Specific lists (software/network) */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-list-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-list-item span:first-child {
    font-weight: 500;
}

.data-list-item span:last-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Cybersecurity & Endpoint Security EDR Overhaul
   ========================================================================== */

.cyber-card-interactive {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.cyber-card-interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cyber-card-interactive.active {
    border-color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.07);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cyber-card-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.2s;
}

.cyber-card-interactive:hover .cyber-card-hint {
    color: var(--accent, #60a5fa);
}

.cyber-drilldown-drawer {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    animation: cyberDrawerSlide 0.25s ease-out;
}

@keyframes cyberDrawerSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-chip.enabled {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.profile-chip.disabled {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.compliance-audit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
}

.cyber-module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    position: sticky;
    top: -1.5rem;
    z-index: 5;
    background: rgba(20, 20, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cyber-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cyber-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.cyber-search-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    font-size: 0.85rem;
    outline: none;
    width: 260px;
    transition: all 0.2s;
}

.cyber-search-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.55);
}

.cyber-filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cyber-filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.cyber-filter-pill.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-weight: 600;
}

.cyber-filter-pill[data-task-filter="Running"].active,
.cyber-filter-pill[data-net-filter="ESTABLISHED"].active {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
    color: #34d399;
}

.cyber-filter-pill[data-task-filter="Ready"].active,
.cyber-filter-pill[data-net-filter="LISTENING"].active {
    background: rgba(59, 130, 246, 0.18);
    border-color: #3b82f6;
    color: #60a5fa;
}

.cyber-filter-pill[data-task-filter="Disabled"].active,
.cyber-filter-pill[data-net-filter="BOUND"].active {
    background: rgba(156, 163, 175, 0.18);
    border-color: #9ca3af;
    color: #e5e7eb;
}

.cyber-task-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cyber-task-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.cyber-net-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.cyber-net-card:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.badge-running {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-ready {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-disabled {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-queued {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-established {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-listening {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-bound {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-timewait {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.35);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

#endpoint-security-modal .modal-content {
    max-width: 860px;
    width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: height 0.2s ease;
}

#endpoint-security-modal.tab-summary-mode .modal-content {
    height: auto;
}

#endpoint-security-modal:not(.tab-summary-mode) .modal-content {
    height: 620px;
}

#ep-sec-tabs-wrapper {
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(20, 20, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-shrink: 0;
}

#ep-sec-tabs-bar {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#ep-sec-tabs-bar::-webkit-scrollbar {
    display: none;
}

.cyber-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 0.86rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.cyber-tab-btn:hover {
    color: #ffffff;
}

.cyber-tab-btn.active {
    color: #ffffff;
    border-bottom-color: var(--accent-color, #ffffff);
}

.tab-count-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.72rem;
    margin-left: 5px;
    font-weight: 600;
    transition: all 0.2s;
}

.cyber-tab-btn.active .tab-count-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.tab-count-badge.badge-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}

.tab-count-badge.badge-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}
